为什么我们的 Eclipse 3.6 (Helios) PDE 构建会失败并出现 NullPointerException?

发布于 2024-10-23 17:58:19 字数 2135 浏览 1 评论 0原文

我们的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笔落惊风雨 2024-10-30 17:58:19

也许我们的 build.properties 太旧了(可能来自 3.2 的模板),或者我们可能不正确地构建了目标平台,但是感谢 Kai Tödter 的一篇博客文章,我们在绝望中尝试过的众多潜在补救措施之一是(根据 Kai 的“技巧 1”)删除其中的所有内容我们的目标平台目录,除了 pluginsfeatures 目录。这至少阻止了 PDE Build 神秘地窒息,然后错误消息引导我们进行其余的修复。 (在我们的例子中,这些修复几乎完全包括通过单击“添加所需插件”来更新辅助(测试)产品定义的所需插件列表,并删除对 org.eclipse.ant.Optional.junit4 的引用 片段。)

事实上,似乎仅从目标平台的 configuration/config.ini 中删除以下任一行就足以取消 PDE Build:(

eclipse.p2.profile=epp.package.rcp

或)

[email protected]/../p2

...尽管我们更愿意删除除插件和片段之外的所有内容,以免目标平台中隐藏着其他神奇的东西,可能会绊倒我们。

(我们不明白为什么删除其中一行会安抚 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 the plugins and features 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 the org.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:

eclipse.p2.profile=epp.package.rcp

(or)

[email protected]/../p2

...though we have preferred to just strip out everything but plugins and fragments 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.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文