Spring Tool Suite
  1. Spring Tool Suite
  2. STS-2569

NullPointerException in LegacyProjectChecker

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 2.9.2.RELEASE, 3.0.0.M1
    • Component/s: None
    • Labels:
      None

      Description

      !SESSION 2012-04-02 13:16:19.217 -----------------------------------------------
      eclipse.buildId=2.8.1.201111221000-RELEASE
      java.version=1.6.0_31
      java.vendor=Sun Microsystems Inc.
      BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
      Framework arguments:  -product com.springsource.sts.ide
      Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product com.springsource.sts.ide
      
      !ENTRY org.eclipse.ui.workbench 4 2 2012-04-02 13:25:42.364
      !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
      !STACK 0
      java.lang.NullPointerException
      	at com.springsource.sts.maven.internal.legacyconversion.LegacyProjectChecker.earlyStartup(LegacyProjectChecker.java:29)
      	at org.eclipse.ui.internal.EarlyStartupRunnable.runEarlyStartup(EarlyStartupRunnable.java:87)
      	at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:66)
      	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
      	at org.eclipse.ui.internal.Workbench$63.run(Workbench.java:2465)
      	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
      

        Activity

        Hide
        Martin Lippert (c) added a comment -

        The LegacyProjectChecker is registered and called as an early startup extension. It then accesses the plugins default object, which is itself created when the bundle gets started (the usual mechanism). Although the bundle is defined as automatically being activated when one of its classes is accessed, the package of the LegacyProjectChecker is explicitly excluded from this rule. Therefore it looks like the ProjectLegacyChecker could be executed without the bundle being started before, and the NPE happens.

        Assigning to Andrew, he might know more about why that package is explicitly excluded from the bundle activation policy.

        Show
        Martin Lippert (c) added a comment - The LegacyProjectChecker is registered and called as an early startup extension. It then accesses the plugins default object, which is itself created when the bundle gets started (the usual mechanism). Although the bundle is defined as automatically being activated when one of its classes is accessed, the package of the LegacyProjectChecker is explicitly excluded from this rule. Therefore it looks like the ProjectLegacyChecker could be executed without the bundle being started before, and the NPE happens. Assigning to Andrew, he might know more about why that package is explicitly excluded from the bundle activation policy.
        Hide
        Andrew Eisenberg (c) added a comment -

        That's probably a bug that LegacyProjectChecker could be executed before the STS maven plugin is started.

        Excluding the legacyconversion package from lazy starting in the manifest is there as an optimization for startup, but obviously this can cause errors if the plugin has not already been started. So, it's apparent that the optimization is useless. I'll remove the lazy startup exclusion from the manifest and the error should go away.

        Show
        Andrew Eisenberg (c) added a comment - That's probably a bug that LegacyProjectChecker could be executed before the STS maven plugin is started. Excluding the legacyconversion package from lazy starting in the manifest is there as an optimization for startup, but obviously this can cause errors if the plugin has not already been started. So, it's apparent that the optimization is useless. I'll remove the lazy startup exclusion from the manifest and the error should go away.
        Hide
        Andrew Eisenberg (c) added a comment -

        I pushed the change and it will be available in the next nightly build.

        Show
        Andrew Eisenberg (c) added a comment - I pushed the change and it will be available in the next nightly build.
        Hide
        Martin Lippert (c) added a comment -

        Added this fix to the 2.9.2 release code base.

        Show
        Martin Lippert (c) added a comment - Added this fix to the 2.9.2 release code base.

          People

          • Assignee:
            Andrew Eisenberg (c)
            Reporter:
            Oliver Gierke
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              First Response Date: