Start an osgi bundle failed with Require-Bundle: org.eclipse.core.runtime; bundle-version=“0.0.0”

北战南征 提交于 2019-11-28 10:52:17

问题


I'm trying to install and load an external bundle to a simple equinox application.

The targeted bundle is coming from a set of plugins for eclipse available here:

http://sourceforge.net/projects/rodin-b-sharp/files/Core_Rodin_Platform/2.4/ (rodin-2.4-dev.zip).

When I start equinox:

$ java -jar org.eclipse.osgi_3.7.1.R37x_v20110808-1106.jar -console

I can install it

osgi> install file:///path_to/rodin-2.4-dev/org.eventb.core_2.4.0.r14093.jar
Bundle id is 1

But I have an exception when I start it:

osgi> start 1
org.osgi.framework.BundleException: The bundle "org.eventb.core_2.4.0.r14093 [1]" 
  could not be resolved. Reason: Missing Constraint: Require-Bundle:  
  org.eclipse.core.runtime; bundle-version="0.0.0"

Does anyone know how to fix this error ?

Maybe it is related to the fact that the bundle does not include a org.eclipse.core.runtime version, as MANIFEST.MF has the following Require-Bundle:

Require-Bundle: org.eclipse.core.runtime,org.rodinp.core;visibility:=r
  eexport,org.eventb.core.ast;visibility:=reexport,org.eventb.core.seqp
  rover;visibility:=reexport

回答1:


The bundle has a requirement to the runtime core as you have noticed. The install just installs the bundle, it does not mean it is valid. You can check the state of the bundle through diag command, i.e, osgi> diag 1

It needs to be in state resolved to be runnable. I'd bet it is just in state installed for you. Check Dude, where's my bundle for more info on bundles and their states.



来源:https://stackoverflow.com/questions/9788404/start-an-osgi-bundle-failed-with-require-bundle-org-eclipse-core-runtime-bundl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!