Search code examples
eclipseosgiequinox

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


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

Solution

  • 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.