-
1. Re: Servicemix and javax.sql
stlewis May 20, 2009 9:01 AM (in response to pchandler)Have you tried adding this package to <Import-Package> for the maven-bundle-plugin in your POM? Not sure if your code explicitly imports this package, if it doesn't you may need to add this import.
-
2. Re: Servicemix and javax.sql
ubhole May 20, 2009 9:07 AM (in response to pchandler)If the Import-Package doesn't help you can try modifying the etc/config.properties and add the package to org.osgi.framework.bootdelegation list so that it is accessible to all bundles.
Ulhas
-
3. Re: Servicemix and javax.sql
pchandler May 20, 2009 2:13 PM (in response to stlewis)The good news is that by adding the "javax.(s)" to the Manifest Import-Package: I was able to get my bundle to run. Thanks.
The bad news is that I should not have to.
In my MANIFEST header I specified Bundle-RequiredExecutionEnvironment: JavaSE-1.6 and since Java SE 1.6.x contain all my required javax.(s) I should not have to specify the classes in the Manifest Import-Package: section (the classes should already be in my Java SE 1.6.x Execution Environment). - my opinion.
Thanks for the help,
Peter.
-
4. Re: Servicemix and javax.sql
stlewis May 20, 2009 2:41 PM (in response to pchandler)Hey Peter,
Had a look in the spec and did some digging; setting Bundle-RequiredExecutionEnvironment doesn't actually mean you'll automatically get the javax.* packages pulled in, you still need to actually specify packages your bundle needs to import as necessary. The header here tells BND what execution environments your bundle supports.
-
5. Re: Servicemix and javax.sql
pchandler May 20, 2009 5:57 PM (in response to stlewis)Bundle-RequiredExecutionEnvironment: JavaSE-1.6
I agree that not all javax.* are in http://java.sun.com/javase/technologies/index.jsp But javax.sql has been built into the jre/jdk for sometime now.
Bundle-RequiredExecutionEnvironment contains a comma-separated
list of execution environments that must be present on the Service Platform (in this case the ServiceMix OSGi Kerrnal).
No worries, Thanks for your help,
Peter.
-
6. Re: Servicemix and javax.sql
pchandler May 22, 2009 9:51 AM (in response to stlewis)After looking into etc/config.properties I have a follow-up question:
Does:
In Equinox:
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Equals
In ServiceMix
Bundle-RequiredExecutionEnvironment: jre-1.6 ?
If I set Bundle-RequiredExecutionEnvironment: jre-1.6 will all classes defined in etc/config.properties be in my bundle's classpath?
-
7. Re: Servicemix and javax.sql
stlewis May 22, 2009 10:17 AM (in response to pchandler)Hi Peter,
You're better off using Ulhas's suggestion if you don't want to use Import-Package. Again I don't see in the OSGI spec that this header actually has anything to do with classloading, it's instead used to check at runtime that the container can support your bundle.
-
8. Re: Servicemix and javax.sql
pchandler May 22, 2009 2:08 PM (in response to stlewis)For the record, putting the following in the manifest:
Bundle-RequiredExecutionEnvironment: jre-1.6
Doesn't work (does not make the class(es) available to your bundle).
The Import-Package will work.
Thanks again,
Peter.