Exporting a bundle with dependencies with another bundles [message #779782] |
Mon, 16 January 2012 14:54 |
Pablo G Messages: 1 Registered: January 2012 |
Junior Member |
|
|
I have this OSGI configuration:
/configurations
config.ini
somebundle.properties
/plugins
bundleA
bundleB
osgi-3.4.2-R34x_v2008826-1230.jar
org.eclipse.equinox.common_3.4.0.v20080421-2006.jar
org.eclipse.update.configurator_3.2.201.R34x_v20080819.jar
com.test.arquitectura.osgi.ConfiguratorModule_1.0.0.jar
My config.ini is like this:
osgi.bundles=org.eclipse.equinox.common@2:start, \
org.eclipse.update.configurator@3:start, \
com.test.arquitectura.osgi.ConfiguratorModule_1.0.0.jar@3:start
osgi.clean = true
eclipse.ignoreApp=true
osgi.parentClassLoader=app
So, AFAIK, when I execute
java -Xms256M -Xmx1280M -jar osgi-3.4.2-R34x_v20080826-1230.jar
It reads config.ini so with equinox.common and update.configurator bundles it "detects" all bundles deployed in /plugins folder. After that, the ConfiguratorModule (a custom bundle) just reads all bundles in the context and executes start method of each one (bundleA and bundleB). I have an eclipse project (bundleC), which uses some clases defined in bundleA and bundleB, so the MANIFEST.MF is:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: BundleC Plug-in
Bundle-SymbolicName: com.test.bundlec
Bundle-Version: 1.0.0
Bundle-Activator: com.test.bundlec.Activator
Import-Package: javax.naming,javax.sql,org.osgi.framework;version="1.3
.0",org.osgi.util.tracker;version="1.3.1"
Bundle-ClassPath: .
Require-Bundle: com.test.BundleA;bundle-version="1.0.0",
com.test.BundleB;bundle-version="1.0.0"
So, I want to generate a plugin (jar) file for the bundleC project. As there are two bundles in the "Require-bundle" option, those projects (BundleA and BundleB) should be in the bundleC classpath, isn´t it? So, in that case, I just generate the bundle (by exporting it as "Plugin Development") and place the new bundle in the plugin folder. Is there something I'm missing?
Well, in case all I´ve said is correct, here is my problem. I have the plugin jar file for BundleA and BundleB but I don´t have the source code of them, so I get an error when exporting BundleC to a jar plugin because, as it seem obvious, it can´t find the required classes it uses from BundleA and BundleB. Is there any way to generate the plugin without those required-bundles in the classpath?
I´ve tried to "decompile" them and then create the projects, and adding them in the classpath of BundleC. I can generate the plugin, but I guess there's a simple and correct way to achieve that.
Thanks for your answers
|
|
|
|
Powered by
FUDForum. Page generated in 0.03203 seconds