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

Moving Spring context from one Spring project to another triggers NullPointerException

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.2.RELEASE
    • Fix Version/s: 2.8.0.RC2
    • Component/s: None
    • Labels:
      None

      Description

      – Error Details –
      Date: Wed Oct 05 19:48:50 BST 2011
      Message: Errors running builder 'Spring Project Builder' on project 'XXXX'.
      Severity: Error
      Product: SpringSource Tool Suite 2.7.2.201109131000-RELEASE (com.springsource.sts.ide)
      Plugin: org.springframework.ide.eclipse.core
      Session Data:
      eclipse.buildId=2.7.2.201109131000-RELEASE
      java.version=1.6.0_25
      java.vendor=Sun Microsystems Inc.
      BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
      Framework arguments: -product com.springsource.sts.ide -refresh -showlocation
      Command-line arguments: -os win32 -ws win32 -arch x86 -product com.springsource.sts.ide -refresh -showlocation

      Exception Stack Trace:

      java.lang.NullPointerException
      	at org.springframework.ide.eclipse.beans.core.internal.model.BeansProject.getConfig(BeansProject.java:476)
      	at org.springframework.ide.eclipse.beans.core.internal.model.BeansProject.getConfigs(BeansProject.java:423)
      	at org.springframework.ide.eclipse.beans.core.internal.model.BeansProject.getConfig(BeansProject.java:413)
      	at org.springframework.ide.eclipse.beans.core.internal.model.BeansModel.getConfig(BeansModel.java:235)
      	at org.springframework.ide.eclipse.beans.core.BeansCoreUtils.isBeansConfig(BeansCoreUtils.java:43)
      	at org.springframework.ide.eclipse.aop.core.util.AopReferenceModelUtils.getAffectedFiles(AopReferenceModelUtils.java:165)
      	at org.springframework.ide.eclipse.aop.core.builder.AopReferenceModelProjectBuilder.getAffectedResources(AopReferenceModelProjectBuilder.java:50)
      	at org.springframework.ide.eclipse.core.internal.project.SpringProjectContributionManager$ResourceDeltaVisitor.visit(SpringProjectContributionManager.java:324)
      	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:69)
      	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
      	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
      	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
      	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
      	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:49)
      	at org.springframework.ide.eclipse.core.internal.project.SpringProjectContributionManager.getAffectedResources(SpringProjectContributionManager.java:138)
      	at org.springframework.ide.eclipse.core.internal.project.SpringProjectContributionManager.build(SpringProjectContributionManager.java:97)
      	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
      	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
      	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
      	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
      	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
      	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
      	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
      	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
      	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
      	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
      	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
      	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
      

        Activity

        Hide
        Martin Lippert (c) added a comment -

        Thanks for reporting this NPE. Do you have any steps for me to reproduce the problem? Just dragging a config file from one project to another doesn't trigger this NPE here on my end. And does it happen every time you move a config file to another project?

        Show
        Martin Lippert (c) added a comment - Thanks for reporting this NPE. Do you have any steps for me to reproduce the problem? Just dragging a config file from one project to another doesn't trigger this NPE here on my end. And does it happen every time you move a config file to another project?
        Hide
        Andreas Nyberg added a comment -

        Actually I have since realized that it might have been more complicated. The target directory already contained one version-controlled file with the same name as one of the files I copied, and I later discovered that the copy had resulted in all files ending up where I wanted them, but the Perforce version control had marked the file as deleted rather than changed.

        So I could see and edit the replaced file, but Perforce was confused, and perhaps SpringIDE in the same way.

        Show
        Andreas Nyberg added a comment - Actually I have since realized that it might have been more complicated. The target directory already contained one version-controlled file with the same name as one of the files I copied, and I later discovered that the copy had resulted in all files ending up where I wanted them, but the Perforce version control had marked the file as deleted rather than changed. So I could see and edit the replaced file, but Perforce was confused, and perhaps SpringIDE in the same way.
        Hide
        Martin Lippert (c) added a comment -

        And what do you see if you "just" move Spring config files around between projects (without having one with the same name)? Does that produce the NPE as well?

        Show
        Martin Lippert (c) added a comment - And what do you see if you "just" move Spring config files around between projects (without having one with the same name)? Does that produce the NPE as well?
        Hide
        Martin Lippert (c) added a comment -

        I added the appropriate checks to avoid the NPE, will be included in 2.8.0.RC2.

        Nevertheless I would be interested to find out what exactly is causing this situation.

        Show
        Martin Lippert (c) added a comment - I added the appropriate checks to avoid the NPE, will be included in 2.8.0.RC2. Nevertheless I would be interested to find out what exactly is causing this situation.

          People

          • Assignee:
            Unassigned
            Reporter:
            Andreas Nyberg
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              First Response Date: