bndtools/bndtools — Issue #229: NPE in builder due to unimported projects
Author: davemssavage
Created: 2011-10-24 08:58:09+00:00
State: open

I've been getting this build error in eclipse every so often:

java.lang.NullPointerException
at bndtools.builder.NewBuilder.getDependencyTargetChange(NewBuilder.java:268)
at bndtools.builder.NewBuilder.build(NewBuilder.java:111)
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)

I finally got a chance to look at the NewBuilder and figured out the actual problem is 'project' is null which is highlighted by this message a little earlier in the error log:

Dependency project 'org.bndtools.embeddedrepo' from project 'bndtools.build' is not in the Eclipse workspace.

We need a better way to deal with missing project dependencies than an NPE in the builder, one suggestion is we could raise a problem on the project, other ideas?

For the moment I've fixed my IDE build by importing the project which clears the build error