如何设置正确的Equinox安装

4

我在谷歌上搜索了几个小时,但是没有找到有用的信息。 我已经开发了一些OSGi bundles,并且现在想在Eclipse IDE之外的equinox容器中运行它们,但总是会抛出异常:

!SESSION 2011-01-03 14:26:58.958 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_CH
Framework arguments:  -Dosgi.clean=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -console;
Command-line arguments:  -consoleLog -Dosgi.clean=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -console;

!ENTRY org.eclipse.osgi 4 0 2011-01-03 14:26:59.567
!MESSAGE Error starting bundle: initial@reference:file:javax.transaction_1.1.1.v201006150915.jar/
!STACK 0
org.osgi.framework.BundleException: A fragment bundle cannot be started: javax.transaction_1.1.1.v201006150915 [49]
        at org.eclipse.osgi.framework.internal.core.BundleFragment.startWorker(BundleFragment.java:228)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.startBundle(EclipseStarter.java:1133)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.startBundles(EclipseStarter.java:1126)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.loadBasicBundles(EclipseStarter.java:646)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:301)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.main(EclipseStarter.java:150)
init dd core...

!ENTRY org.eclipse.osgi 4 0 2011-01-03 14:26:59.773
!MESSAGE Bundle javax.transaction_1.1.1.v201006150915 [49] is not active.

(“init dd core…”的文本是来自我的项目。)
我有以下的文件结构:
+configuration
 +config.ini
+ch.thobens.dd.commands_1.0.0.jar
+ch.thobens.dd.common.items_1.0.0.jar
+ch.thobens.dd.core_1.0.0.jar
+ch.thobens.dd.game_1.0.0.jar
+javax.transaction_1.1.1.v201006150915.jar
+org.eclipse.core.contenttype_3.4.100.v20100505-1235.jar
+org.eclipse.core.jobs_3.5.0.v20100515.jar
+org.eclipse.core.runtime.compatibility.auth_3.2.200.v20100517.jar
+org.eclipse.core.runtime.compatibility.registry_3.3.0.v20100520/runtime_registry_compatibility.jar
+org.eclipse.core.runtime_3.6.0.v20100505.jar
+org.eclipse.equinox.app_1.3.0.v20100512.jar
+org.eclipse.equinox.common_3.6.0.v20100503.jar
+org.eclipse.equinox.preferences_3.3.0.v20100503.jar
+org.eclipse.equinox.registry_3.5.0.v20100503.jar
+org.eclipse.osgi.services_3.2.100.v20100503.jar
+org.eclipse.osgi_3.6.0.v20100517.jar

我的config.ini文件包含以下内容:
osgi.bundles=javax.transaction_1.1.1.v201006150915.jar@start, org.eclipse.core.contenttype_3.4.100.v20100505-1235.jar@start, org.eclipse.core.jobs_3.5.0.v20100515.jar@start, org.eclipse.core.runtime.compatibility.auth_3.2.200.v20100517.jar@start,org.eclipse.core.runtime.compatibility.registry_3.3.0.v20100520/runtime_registry_compatibility.jar@start, org.eclipse.core.runtime_3.6.0.v20100505.jar@start, org.eclipse.equinox.app_1.3.0.v20100512.jar@start, org.eclipse.equinox.common_3.6.0.v20100503.jar@2:start, org.eclipse.equinox.preferences_3.3.0.v20100503.jar@start, org.eclipse.equinox.registry_3.5.0.v20100503.jar@start, org.eclipse.osgi.services_3.2.100.v20100503.jar@start, ch.thobens.dd.commands_1.0.0.jar@start, ch.thobens.dd.common.items_1.0.0.jar@start, ch.thobens.dd.core_1.0.0.jar@start, ch.thobens.dd.game_1.0.0.jar@1:start
eclipse.ignoreApp=true
osgi.noShutdown=true

这里列出的捆绑包是当我在运行配置中选择“添加必需插件”时所选的捆绑包。如果我从Eclipse PDE运行这些捆绑包,则可以正常工作。
此外,执行以下命令没有任何区别:
java -jar org.eclipse.osgi_3.6.0.v20100517.jar -consoleLog -Dosgi.clean=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true

当我使用昼夜平衡启动器(通过eclipse.exe)时。

感谢任何帮助。

1个回答

6
我通过Eclipse产品导出器找到了解决方案:
javax.transaction_1.1.1.v201006150915.jar本身不是一个OSGi bundle,而是一个OSGi框架扩展插件。
我需要改变config.ini文件:
1. 在属性osgi.bundles中删除javax_transaction bundle的条目 2. 添加以下行: osgi.framework.extensions=javax.transaction_1.1.1.v201006150915.jar

2
实际上,它看起来像是javax.transaction是一个片段捆绑包。你本可以将其留在osgi.bundles列表中,只需删除@start即可。但无论如何,我不会期望错误是致命的,所以你可以继续运行应用程序。只是在日志中出现这样的异常看起来不太好而已;-) - Neil Bartlett

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接