我有一个带有以下命令行参数的独立 headless RCP。
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -clean -consoleLog
我可以成功生成要作为命令行工具运行的二进制文件,但问题是我必须修改 config.ini 文件
osgi.bundles=org.eclipse.equinox.common@2:start,
org.eclipse.update.configurator@3:start,
org.eclipse.equinox.ds@2:start,
org.eclipse.core.runtime@s
至
osgi.bundles=org.eclipse.equinox.common@2:start,
org.eclipse.update.configurator@3:start,
org.eclipse.equinox.ds@3:start, <---
org.eclipse.core.runtime@s
如果没有进行此更改,我在执行二进制文件时会收到这些错误消息。
org.osgi.framework.BundleException: The bundle "org.eclipse.equinox.ds_1.4.0.v20120522-1841 [3]" could not be resolved. Reason: Missing Constraint: Import-Package: org.eclipse.equinox.internal.util.event; version="1.0.0"
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1332)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1316)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
“org.eclipse.equinox.ds@3:start”背后的魔力?为什么我修改后效果很好?如何在 Eclipse IDE 中进行设置,以便在创建 headless RCP 时不必一直手动更改 ini 文件。
最佳答案
我可以解释更改背后的魔力,但不幸的是我不熟悉从 Eclipse 导出应用程序。
osgi.bundles
是一个属性,定义哪些 bundle 可用以及何时(例如在 start level )它们应该启动。平台加载并启动这些 bundle 的级别为 1,然后为 2,依此类推,直到 osgi.startLevel
(默认值为 6,如上面链接的 juno 文档中所述)。
为了启动org.eclipse.equinox.ds
该平台需要加载导出 org.eclipse.equinox.internal.util.event
版本 1.0.0 的 bundle 包裹。从一些搜索来看,这似乎是 org.eclipse.equinox.util
捆绑。
因此,通过从 @2 更改为 @3,您可以将 ds bundle 的启动时间推迟到加载 util bundle 之后的平台启动时间点。我怀疑这里有帮助的是 org.eclipse.update.configurator
bundle (因为它是一个 bundle ,其工作是 load all the bundles from the plugins directory 。)
关于java - "org.eclipse.equinox.ds@3:start"背后的魔力?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14408605/