First of all, in most cases, the exception like
comes from the bundle which manage the datasource/connectionPool, which is 3rd party bundle like commons-dbcp or spring-jdbc, it's not your customer bundle, which means you are hard to change those 3rd party bundle headers, so your question 1,2,3 doesn't work.
And please take a look at my comment here
Thanks for the reply. I ended up doing the following:
1. Installed oracle jdbc JAR and UCP.jar into Fuse ESB using the "wrap" option.
2. Removed the embedded JARs from bundle A (the datasources provider bundle) and let it import the required packages from #1. I used a DynamicImport-Package *. This was important as multiple instances of the JARs in multiple classloaders were causing other problems.
3. Added a DynamicImport-Package * to bundle B (and any other bundle using datasources) so that they will search for and find any necessary oracle classes from the new wrapped bundles.
The DynamicImport was easier because it was difficult to know which Oracle classes and packages would actually be used. I went through several before I just put in the DynamicImport.
Also it seems important not to have those Oracle Jar's anywhere else in the system. Only the one wrapped bundle should contain the JARs, otherwise I was getting strange exceptions from oracle.
Finally, I had to restart the ESB everytime I deployed. Seemed things were not uninstalling properly and it needed to start up clean. I don't know why this was required, but not a big deal for me.
I think some of the other options might have had trouble because of the necessity of only loading up the oracle classes once. I was receiving things like "Instance already created" when requesting the pool, so I would be worried about embedding those jars in multiple bundles or even attaching as a fragment to multiple bundles.
If you had one bundle using a datasource and another bundle using a different datasource and they each had embedded or fragmented bundles maybe this would be okay; but in the case where i have multiple bundles trying to share the same datasource it seems a requirement to get those oracle jars into their own single shared bundle.
Thanks for the answer and the help. The problem is resolved, and I think I understand things better now that I've cleaned up my own mess.