如何配置用户包以便它们可以以更高的优先级自动启动 - 因此比其他包更早?

How to configure user bundles so that they can be autostarted with higher priority - hence earlier than others?

我需要先 运行 某些插件。首先想到的是在“\configuration\bundles.info”中添加捆绑名称和优先级,但在 OSGI 启动时它抛出错误 java.lang.Exception: Could not find plugin com.example.myplugin。 添加的行与此类似: com.example.myplugin,1.1.1,dropins/MY-ARTIFACT-1.2.3-SNAPSHOT/eclipse/plugins/com.example.myplugin-1.1.0.SNAPSHOT.jar,2,true

然后我给\configuration\config.ini添加了参数:

osgi.bundles=reference\:file\com.example.myplugin-1.1.0.SNAPSHOT.jar@2\:start

同样的错误仍然存​​在。如何解决?

你是对的。 OSGi 中的起始级别由您放入 config.ini 文件中的 @2 定义。默认(默认情况下)的起始级别为 4。 您的问题似乎更多地与访问包的目录路径问题有关,而不是您的包本身的加载顺序。