gpt4 book ai didi

java - 在敌对环境中运行 OSGi Equinox 控制台

转载 作者:行者123 更新时间:2023-12-01 23:46:50 26 4
gpt4 key购买 nike

假设我有这个 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=unknown java.version=1.7.0_17 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US Command-line arguments: -console -consoleLog

!ENTRY org.eclipse.osgi 4 0 2013-06-04 08:57:53.512 !MESSAGE Application error !STACK 1 java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini). at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at 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

欢迎任何提示。提前致谢。

最佳答案

如果您使用普通 OSGi(而不是 Eclipse 应用程序),您应该将以下内容添加到您的 config.ini 中:

eclipse.ignoreApp=true
osgi.noShutdown=true

此外,如果您不确定使用哪个 config.ini,您可以通过提供 cmd arg 显式定义路径:

java -jar .... -configuration <location of config.ini>

关于java - 在敌对环境中运行 OSGi Equinox 控制台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16911584/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com