为什么我们的 Eclipse 3.6 (Helios) PDE 构建会失败并出现 NullPointerException?
我们的 Eclipse RCP 应用程序具有来自 Eclipse 3.2 的无头 PDE 构建设置,该设置已运行多年。我们最近将用于执行无头 PDE 构建的 Eclipse 实例和目标平台更新为 3.6(原则上 能够创建“进入”我们的应用程序的超链接),无头 PDE 构建现在失败并显示:
...
[java] generateFeature:
[java]
[java] fetch:
[java]
[java] generateFeature:
[java]
[java] BUILD FAILED
[java] C:\Projects\[...]\PDE Build\plugins\org.eclipse.pde.build_3.6.2.R36x_20110203\scripts\productBuild\productBuild.xml:39: The following error occurred while executing this line:
[java] C:\Projects\[...]\PDE Build\plugins\org.eclipse.pde.build_3.6.2.R36x_20110203\scripts\productBuild\productBuild.xml:69: java.lang.NullPointerException
[java]
[java] Total time: 0 seconds
[java] An error has occurred. See the log file
[java] C:\Projects\[...a separate area dedicated to making builds...]\workspace\.metadata\.log.
日志文件中堆栈跟踪的相关部分似乎是:
java.lang.NullPointerException
at org.eclipse.pde.internal.build.BundleHelper.getProvisioningAgent(BundleHelper.java:104)
at org.eclipse.pde.internal.build.AbstractScriptGenerator.getAssociatedRepositories(AbstractScriptGenerator.java:625)
at org.eclipse.pde.internal.build.AbstractScriptGenerator.getSite(AbstractScriptGenerator.java:332)
at org.eclipse.pde.internal.build.FeatureGenerator.createFeature(FeatureGenerator.java:339)
at org.eclipse.pde.internal.build.FeatureGenerator.generate(FeatureGenerator.java:161)
at org.eclipse.pde.internal.build.tasks.FeatureGeneratorTask.run(FeatureGeneratorTask.java:54)
at org.eclipse.pde.internal.build.tasks.FeatureGeneratorTask.execute(FeatureGeneratorTask.java:36)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
...
< code>PDE Build Eclipse 实例是根据 此过程。我们试图尽可能地创建一个干净的目标平台,但是(在没有明确说明或早期成功的情况下)只好将 eclipse-rcp-helios-SR2-win32.zip 解压到一个目录中,然后将 eclipse-3.6.2-delta-pack.zip
解压到它上面。
我们如何才能将 PDE 构建流程恢复到正常工作状态?
Our Eclipse RCP application has a headless PDE Build setup from Eclipse 3.2 that's been working for years. We recently updated both the instance of Eclipse we use to do the headless PDE Build and our target platform to 3.6 (principally to be able to create hyperlinks "into" our application), and the headless PDE Build now fails with:
...
[java] generateFeature:
[java]
[java] fetch:
[java]
[java] generateFeature:
[java]
[java] BUILD FAILED
[java] C:\Projects\[...]\PDE Build\plugins\org.eclipse.pde.build_3.6.2.R36x_20110203\scripts\productBuild\productBuild.xml:39: The following error occurred while executing this line:
[java] C:\Projects\[...]\PDE Build\plugins\org.eclipse.pde.build_3.6.2.R36x_20110203\scripts\productBuild\productBuild.xml:69: java.lang.NullPointerException
[java]
[java] Total time: 0 seconds
[java] An error has occurred. See the log file
[java] C:\Projects\[...a separate area dedicated to making builds...]\workspace\.metadata\.log.
The relevant part of the stack trace in the log file would seem to be:
java.lang.NullPointerException
at org.eclipse.pde.internal.build.BundleHelper.getProvisioningAgent(BundleHelper.java:104)
at org.eclipse.pde.internal.build.AbstractScriptGenerator.getAssociatedRepositories(AbstractScriptGenerator.java:625)
at org.eclipse.pde.internal.build.AbstractScriptGenerator.getSite(AbstractScriptGenerator.java:332)
at org.eclipse.pde.internal.build.FeatureGenerator.createFeature(FeatureGenerator.java:339)
at org.eclipse.pde.internal.build.FeatureGenerator.generate(FeatureGenerator.java:161)
at org.eclipse.pde.internal.build.tasks.FeatureGeneratorTask.run(FeatureGeneratorTask.java:54)
at org.eclipse.pde.internal.build.tasks.FeatureGeneratorTask.execute(FeatureGeneratorTask.java:36)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
...
The PDE Build
Eclipse instance was created according to this process. We tried to produce as clean a target platform as we could, but (in the absence of clear instructions or early success) resorted to unzipping eclipse-rcp-helios-SR2-win32.zip
into a directory then unzipping eclipse-3.6.2-delta-pack.zip
on top of it.
How can we restore our PDE Build process to working order?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许我们的
build.properties
太旧了(可能来自 3.2 的模板),或者我们可能不正确地构建了目标平台,但是感谢 Kai Tödter 的一篇博客文章,我们在绝望中尝试过的众多潜在补救措施之一是(根据 Kai 的“技巧 1”)删除其中的所有内容我们的目标平台目录,除了plugins
和features
目录。这至少阻止了 PDE Build 神秘地窒息,然后错误消息引导我们进行其余的修复。 (在我们的例子中,这些修复几乎完全包括通过单击“添加所需插件”来更新辅助(测试)产品定义的所需插件列表,并删除对 org.eclipse.ant.Optional.junit4 的引用 片段。)事实上,似乎仅从目标平台的
configuration/config.ini
中删除以下任一行就足以取消 PDE Build:(或)
...尽管我们更愿意删除除插件和片段之外的所有内容,以免目标平台中隐藏着其他神奇的东西,可能会绊倒我们。
(我们不明白为什么删除其中一行会安抚 PDE Build ......但我们又回到了正轨。)
Perhaps our
build.properties
is too old (from 3.2's template, probably), or perhaps we constructed our target platform improperly, but thanks to a blog post by Kai Tödter, one of the many potential remedies we tried in desperation was (according to Kai's "Trick 1") deleting everything out of our target platform directory except theplugins
andfeatures
directories. That at least stopped PDE Build mysteriously choking, and error messages then guided us to the rest of the fixups we had to do. (In our case, those fixups consisted almost entirely of updating a secondary (tests) product definition's list of required plugins by clicking "Add Required Plug-ins" and removing a reference to theorg.eclipse.ant.optional.junit4
fragment.)Indeed, it appears that merely deleting either one of the following lines from the target platform's
configuration/config.ini
is sufficient to unstick PDE Build:(or)
...though we have preferred to just strip out everything but
plugins
andfragments
lest there be other magical beings hiding in the target platform that could potentially trip us up.(We don't understand why deleting one of those lines would placate PDE Build . . . but we're back in business.)