Community
Participate
Working Groups
Build Identifier: eclipse-SDK-3.6RC3 I created a simple feature com.ent.customized.toolkit which includes feature org.eclipse.platform and plugin com.ent.customized.toolkit.branding. A product definition was created to include this feature. The product can be exported properly in the GUI. The feature and plugin were moved to another directory to set up a headless product build. The build.properties file from org.eclipse.pde.build_3.6.0.v20100526\templates\headless-build was copied over and customized. When runBuild.bat was run to start the build, I got the following messages. D:\HeadlessBuild\configuration>runbuild D:\HeadlessBuild\configuration>set Path=D:\toolkit 34\eclipse\jre\bin D:\HeadlessBuild\configuration>set eclipseHome=D:\eclipse-SDK-3.6RC3 D:\HeadlessBuild\configuration>java -jar D:\eclipse-SDK-3.6RC3\eclipse\plugins\o rg.eclipse.equinox.launcher_1.1.0.v20100507.jar -application org.eclipse.ant.cor e.antRunner -buildfile D:\eclipse-SDK-3.6RC3\eclipse\plugins\org.eclipse.pde.bui ld_3.6.0.v20100526\scripts\productBuild\productBuild.xml -Dbuilder=D:\HeadlessBu ild\configuration Buildfile: D:\eclipse-SDK-3.6RC3\eclipse\plugins\org.eclipse.pde.build_3.6.0.v20 100526\scripts\productBuild\productBuild.xml main: preBuild: preSetup: checkLocalMaps: getMapFiles: postSetup: checkLocalBase: getBaseComponents: processRepos: generateFeature: fetch: generateFeature: BUILD FAILED D:\eclipse-SDK-3.6RC3\eclipse\plugins\org.eclipse.pde.build_3.6.0.v20100526\scri pts\productBuild\productBuild.xml:39: The following error occurred while executi ng this line: D:\eclipse-SDK-3.6RC3\eclipse\plugins\org.eclipse.pde.build_3.6.0.v20100526\scri pts\productBuild\productBuild.xml:69: java.lang.NullPointerException The build directory is zipped and attached Reproducible: Always
Created attachment 171114 [details] zip file contains the build project
Sam your project built fine for me. Do you have a call stack for the NPE? If not, do get get one if you run with -verbose?
Thank you, Andrew, for looking into this problem. Since it works for you, it might be something wrong in my environment? Here is the stack trace. D:\eclipse-SDK-3.6RC3\eclipse\plugins\org.eclipse.pde.build_3.6.0.v20100526\scri pts\productBuild\productBuild.xml:39: The following error occurred while executi ng this line: D:\eclipse-SDK-3.6RC3\eclipse\plugins\org.eclipse.pde.build_3.6.0.v20100526\scri pts\productBuild\productBuild.xml:69: java.lang.NullPointerException at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(Projec tHelper.java:508) at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:418) at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337) at org.apache.tools.ant.Project.executeTarget(Project.java:1306) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe cutor.java:41) at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTarge ts(EclipseDefaultExecutor.java:32) at org.apache.tools.ant.Project.executeTargets(Project.java:1189) at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu nner.java:662) at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu nner.java:534) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:45) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.eclipse.ant.core.AntRunner.run(AntRunner.java:513) at org.eclipse.ant.core.AntRunner.start(AntRunner.java:600) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandl e.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli cation(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ec lipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:45) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383) Caused by: D:\eclipse-SDK-3.6RC3\eclipse\plugins\org.eclipse.pde.build_3.6.0.v20 100526\scripts\productBuild\productBuild.xml:69: java.lang.NullPointerException at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:116) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337) at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(Single CheckExecutor.java:38) at org.eclipse.ant.internal.core.ant.EclipseSingleCheckExecutor.executeT argets(EclipseSingleCheckExecutor.java:30) at org.apache.tools.ant.Project.executeTargets(Project.java:1189) at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416) ... 35 more Caused by: java.lang.NullPointerException at org.eclipse.pde.internal.build.site.BuildTimeSite.getRegistry(BuildTi meSite.java:121) at org.eclipse.pde.internal.build.FeatureGenerator.createFeature(Feature Generator.java:337) at org.eclipse.pde.internal.build.FeatureGenerator.generate(FeatureGener ator.java:159) at org.eclipse.pde.internal.build.FeatureGenerator.generateNestedRequire ments(FeatureGenerator.java:218) at org.eclipse.pde.internal.build.FeatureGenerator.generate(FeatureGener ator.java:134) at org.eclipse.pde.internal.build.tasks.FeatureGeneratorTask.run(Feature GeneratorTask.java:54) at org.eclipse.pde.internal.build.tasks.FeatureGeneratorTask.execute(Fea tureGeneratorTask.java:36) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106) ... 43 more --- Nested Exception --- D:\eclipse-SDK-3.6RC3\eclipse\plugins\org.eclipse.pde.build_3.6.0.v20100526\scri pts\productBuild\productBuild.xml:69: java.lang.NullPointerException at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:116) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337) at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(Single CheckExecutor.java:38) at org.eclipse.ant.internal.core.ant.EclipseSingleCheckExecutor.executeT argets(EclipseSingleCheckExecutor.java:30) at org.apache.tools.ant.Project.executeTargets(Project.java:1189) at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416) at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337) at org.apache.tools.ant.Project.executeTarget(Project.java:1306) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe cutor.java:41) at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTarge ts(EclipseDefaultExecutor.java:32) at org.apache.tools.ant.Project.executeTargets(Project.java:1189) at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu nner.java:662) at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu nner.java:534) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:45) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.eclipse.ant.core.AntRunner.run(AntRunner.java:513) at org.eclipse.ant.core.AntRunner.start(AntRunner.java:600) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandl e.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli cation(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ec lipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:45) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383) Caused by: java.lang.NullPointerException at org.eclipse.pde.internal.build.site.BuildTimeSite.getRegistry(BuildTi meSite.java:121) at org.eclipse.pde.internal.build.FeatureGenerator.createFeature(Feature Generator.java:337) at org.eclipse.pde.internal.build.FeatureGenerator.generate(FeatureGener ator.java:159) at org.eclipse.pde.internal.build.FeatureGenerator.generateNestedRequire ments(FeatureGenerator.java:218) at org.eclipse.pde.internal.build.FeatureGenerator.generate(FeatureGener ator.java:134) at org.eclipse.pde.internal.build.tasks.FeatureGeneratorTask.run(Feature GeneratorTask.java:54) at org.eclipse.pde.internal.build.tasks.FeatureGeneratorTask.execute(Fea tureGeneratorTask.java:36) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106) ... 43 more --- Nested Exception --- java.lang.NullPointerException at org.eclipse.pde.internal.build.site.BuildTimeSite.getRegistry(BuildTi meSite.java:121) at org.eclipse.pde.internal.build.FeatureGenerator.createFeature(Feature Generator.java:337) at org.eclipse.pde.internal.build.FeatureGenerator.generate(FeatureGener ator.java:159) at org.eclipse.pde.internal.build.FeatureGenerator.generateNestedRequire ments(FeatureGenerator.java:218) at org.eclipse.pde.internal.build.FeatureGenerator.generate(FeatureGener ator.java:134) at org.eclipse.pde.internal.build.tasks.FeatureGeneratorTask.run(Feature GeneratorTask.java:54) at org.eclipse.pde.internal.build.tasks.FeatureGeneratorTask.execute(Fea tureGeneratorTask.java:36) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337) at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(Single CheckExecutor.java:38) at org.eclipse.ant.internal.core.ant.EclipseSingleCheckExecutor.executeT argets(EclipseSingleCheckExecutor.java:30) at org.apache.tools.ant.Project.executeTargets(Project.java:1189) at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416) at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337) at org.apache.tools.ant.Project.executeTarget(Project.java:1306) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe cutor.java:41) at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTarge ts(EclipseDefaultExecutor.java:32) at org.apache.tools.ant.Project.executeTargets(Project.java:1189) at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu nner.java:662) at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu nner.java:534) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:45) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.eclipse.ant.core.AntRunner.run(AntRunner.java:513) at org.eclipse.ant.core.AntRunner.start(AntRunner.java:600) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandl e.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli cation(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ec lipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:45) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Sam, I this is the problem: base=D:\eclipse-SDK-3.6RC3 Because this is a properties file, '\' is an escape character, so you need base=D:\\eclipse-SDK-3.6RC3 or base-D:/eclipse-SDK-3.6RC3 I changed this line when I tried it earlier because I don't have a D: drive. If I leave '\' which creates an incorrect path of "D:eclipse-SDK-3.6RC3", then I see the NPE. I'll look at this in 3.6.1 to see if we can give a better error
Hi Andrew, After the path change, it moved forward but ran into another problem. It now failed to find org.eclipse.pde.build.container.feature. This feature is in D:\HeadlessBuild\configuration\buildDirectory\features. But it tried to find it at the wrong place. Is there a properties I can set to point it to the right place? BUILD FAILED D:\eclipse-SDK-3.6RC3\eclipse\plugins\org.eclipse.pde.build_3.6.0.v20100526\scripts\productBuild\productBuild.xml:42: The following error occurred while executing this line: D:\eclipse-SDK-3.6RC3\eclipse\plugins\org.eclipse.pde.build_3.6.0.v20100526\scripts\build.xml:94: The following error occurred while executing this line: D:\eclipse-SDK-3.6RC3\eclipse\plugins\org.eclipse.pde.build_3.6.0.v20100526\templates\headless-build\customTargets.xml:110: The following error occurred while executing this line: D:\eclipse-SDK-3.6RC3\eclipse\plugins\org.eclipse.pde.build_3.6.0.v20100526\templates\headless-build\customTargets.xml:46: The following error occurred while executing this line: D:\eclipse-SDK-3.6RC3\eclipse\plugins\org.eclipse.pde.build_3.6.0.v20100526\templates\headless-build\customTargets.xml:12: The following error occurred while executing this line: D:\eclipse-SDK-3.6RC3\eclipse\plugins\org.eclipse.pde.build_3.6.0.v20100526\scripts\productBuild\allElements.xml:20: The following error occurred while executing this line: D:\eclipse-SDK-3.6RC3\eclipse\plugins\org.eclipse.pde.build_3.6.0.v20100526\scripts\genericTargets.xml:72: Basedir D:\eclipse-SDK-3.6RC3\eclipse\plugins\org.eclipse.pde.build_3.6.0.v20100526\scripts\productBuild\buildDirectory\features\org.eclipse.pde.build.container.feature does not exist at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:508) at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:418) at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
You define "buildDirectory" with a relative path in your build.properties file. I'm not sure what this ends up being relative to. You should change that to perhaps ${builder}/buildDirectory
Thank you so much, Andrew. You are absolutely right. Once I change the path, it works like a charm. It's so cool. I never imaged that the product build is so easy to set up :) I'm going to move customTargets.xml and productBuild.xml to my configuration directory to do some further customization now. I appreciate your prompt response.
There is no customization in productBuild.xml, you shouldn't move that script. You could customize the allElements.xml if you want, though the productBuild is hardcoded to use its own, so you would need to define "allElementsFile" on the command line the same as you do with -Dbuilder
Created attachment 176412 [details] patch Patch, needs test. The original exception for the bad location was swallowed leaving the build site in a partial state, later on this leads to the NPE.
Created attachment 176828 [details] patch + test New patch + test
fixed. As explanation for the patch: We cache the site factory which handles the PDEState, in the case of a bad baseLocation value, there is a thrown exception and we are left with a partially initialized site. If later we attempt to use that site again, then we get the NPE. The fix is to only cache the site if we were successful in creating it.