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.
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.
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,
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.
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,
After looking into etc/config.properties I have a follow-up question:
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?
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.
For the record, putting the following in the manifest:
Doesn't work (does not make the class(es) available to your bundle).
The Import-Package will work.