【发布时间】:2013-05-30 11:31:26
【问题描述】:
假设我有这个 OSGI Equinox 应用程序,并且我想知道包已加载,以及它们的状态。为此,我考虑过运行控制台,但我不知道该怎么做。
应用程序具有以下文件夹结构:
workspace/
config/
features/
bundles/
config/ 目录包含一个 config.ini 文件以及错误日志文件和一些以插件符号名称命名的文件夹。
我尝试从主(主)文件夹运行
java -jar bundles/org.eclipse.osgi_3.6.0.v20100517.jar -console -consoleLog
但我得到的只是一个
osgi> !SESSION 2013-06-04 08:57:53.023 ----------------------------------------------------------- eclipse.buildId =未知 java.version=1.7.0_17 java.vendor=Oracle 公司 BootLoader 常量:OS=win32, ARCH=x86_64, WS=win32, NL=en_US 命令行参数:-console -consoleLog
!ENTRY org.eclipse.osgi 4 0 2013-06-04 08:57:53.512 !MESSAGE 应用程序错误!堆栈 1 java.lang.IllegalStateException:无法 获取应用服务。确保 org.eclipse.core.runtime 捆绑包已解析并启动(请参阅 config.ini)。 在 org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74) 在 org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) 在 org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) 在 org.eclipse.core.runtime.adaptor.EclipseStarter.main(EclipseStarter.java:150)
这提出了知道config.ini 文件应该在哪里的问题。如前所述,我知道config/ 有一个,虽然我知道这个 RCP 应用程序使用该文件作为其配置文件,但我不太确定我启动的控制台也可以这样说。为什么?因为我在bundles/config.ini 中添加了以下行无济于事:
osgi.bundles=\
org.eclipse.core.runtime@5:start \
org.bountycastle@3:start, \
org.jdom@3:start, \
org.eclipse.equinox.event@3:start, \
org.eclipse.update.configurator@2:start, \
org.eclipse.equinox.common@2:start, \
org.eclipse.equinox.ds@4:start, \
org.eclipse.equinox.util@4:start, \
org.eclipse.core.runtime@start
osgi.startLevel=10
osgi.bundles.defaultStartLevel=5
欢迎任何提示。提前致谢。
【问题讨论】:
-
您能添加其余的 config.ini 吗?我有兴趣看到有关运行级别的任何内容。另外,我有兴趣查看日志的其余部分。
-
我已经用额外的信息编辑了原始帖子。