-
1. Re: How to import class (bean) from an other bundle
ffang May 25, 2010 6:02 AM (in response to walter.accantelli)Hi,
One obvious problem I can tell is
you should use
<Export-Package>
com.bundleexport.beans
</Export-Package>
but not
<Export-Package>
com.bundleexport.beans.BeanToExport
</Export-Package>
Could you change it and do a quick test again?
Freeman
-
2. Re: How to import class (bean) from an other bundle
walter.accantelli May 25, 2010 6:12 AM (in response to ffang)Hi Freeman,
I try, but nothing has changed; error still remain....
-
3. Re: How to import class (bean) from an other bundle
walter.accantelli May 28, 2010 3:42 AM (in response to walter.accantelli)I solved.
1) In bundle export, I removed Export-Package tags from maven-bundle-plugin configuration (by default, all packages that are not defined in Provate-Package tags are exported)
2) In bundle import, there is no need to specify import packages, they are automatically available from all other bundles.
After these changes, I re-build both bundles and it works: I can use exported packages from bundle1 (osgi-export-sample1) into bundle2 (osgi-import-sample1).
Note: I notice that sometimes, in eclipse, it is necessary to "Update Project Configuration" to make changes works (see screenshot).
I attach the updated bundles, hope this can help someone.
walter
-
eclipse-update-prj-conf.png 38.9 KB
-
osgi-import-sample1.zip 8.4 KB
-
osgi-export-sample1.zip 13.4 KB
-