java - "org.eclipse.equinox.ds@3:start"背后的魔力?

标签 java eclipse eclipse-plugin rcp

我有一个带有以下命令行参数的独立 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/

相关文章:

eclipse - 是否可以将jsp预编译到eclipse中?

java - 开发eclipse插件时如何启动特定方法

java - W-shingling 实现 - 存储木瓦

java - Maven - 在运行时查找依赖项

java - 被 java NIO Selector.select() 阻塞的线程应该被视为等待还是正在运行

C++ #include 语句

java - maven pom调用子目录下的其他poms

c - 在 Eclipse 4.4.2 中使用 C 代码中的构建变量

java - Eclipse API : How to get IFile from an IProject using only the file name?

java - 如何在 Eclipse 插件中使用 Timer 和 SwingWorker?