Note that there are some explanatory texts on larger screens.

plurals
  1. POOSGi bundle imports packages from non-bundle jars: create bundles for them?
    text
    copied!<p>I am new to OSGi, and am using Equinox. I have done several searches and can find no answer to this. The discussion at <a href="https://stackoverflow.com/questions/1340483/osgi-handling-3rd-party-jars-required-by-a-bundle">OSGI - handling 3rd party JARs required by a bundle</a> helps somewhat, but does not fully answer my question.</p> <p>I have obtained a jar file, <code>rabbitmq-client.jar</code>, that is already packaged as an OSGi bundle (with Bundle-Name and other such properties in its MANIFEST.MF), that I would like to install as a bundle. This jar imports packages <code>org.apache.commons.io</code> and <code>org.apache.commons.io.input</code> from <code>commons-io-1.2.jar</code>. The RabbitMQ client 2.7.1 distribution also includes <code>commons-cli-1.1.jar</code>, so I presume that it is required as well.</p> <p>I examined the manifests of these commons jars and found that they do not appear to be packaged as bundles. That is, their manifests have none of the standard bundle properties.</p> <p>My specific question is: if I install <code>rabbitmq-client.jar</code> as a bundle, what is the proper way to get access to the packages that it needs to import from the commons jars? There are only three alternatives that I can think of, without rebuilding <code>rabbitmq-client.jar</code>.</p> <ol> <li>The packages from the commons jars are already included in the Equinox global classpath, and <code>rabbitmq-client.jar</code> will get them automatically from there.</li> <li>I must make another bundle with the two commons jars, export the needed packages, and install that bundle in Equinox.</li> <li>I must put these two commons jars in the global classpath when I start Equinox, and they will be available to <code>rabbitmq-client.jar</code> from there.</li> </ol> <p>I have read that one normally does not use the global classpath in an OSGi container. I am not clear on whether items from the global classpath are even available when building individual bundle classpaths. However, I note that <code>rabbitmq-client.jar</code> also imports other packages such as <code>javax.net</code>, which I presume come from the global classpath. Or is there some other bundle that exports them?</p> <p>Thanks for any assistance!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload