This generally means you have two copy of javax.sql.DataSource in your container, but loaded by different classloaders.
Most likely your customer bundle embed jar which have javax.sql.DataSource or some other bundle also export it.
You can use "packages:exports |grep javax.sql"
to check it out, it should be from system bundle 0, and your customer bundle should Import-Package javax.sql, also your customer bundle shouldn't embed javax.sql.DataSource .
I checked which packages export 'javax.sql' using packages:exports |grep javax.sql.
It turns out package 0, and my JDBC driver wrapper package both do.
I changed my package to not export javax.sql, and I still have the same issue.
I then checked which packages include the SimpleDriverDataSource class:
FuseESB:admin@root> osgi:find-class SimpleDriverDataSource
Spring JDBC (253)
Spring ORM (255)
OpenJPA Aggregate Jar (256)
Could this be a problem?
Yes, it could be
At least MyApplication bundle shouldn't embed Spring JDBC.
This is no doubt showing my ignorance here - what what do you mean by 'embed'? A dependency listed in the POM file?
I seem to have my JDBC working .. however getting it started is convoluted, and I do not understand why what I do works.
install my fuse package (packaged as a 'jar') via FAB with the -s option (to start):
osgi:install -s fab:mvn:com.mycompany/myapplication/1.0.0-SNAPSHOT
this fails. however if i do not sopeciify the -s option, the following steps do not work.
This now lists my JDBC bundle as an import. I can now start the package.
FWIW, I am specifying the <DynamicImport-Package>, but it seems to be making no difference. I will obviously need to come pack and work out why this is happening, but I have a basic JDBC connection working, so I nede to move on to try and get some productive development done. I am expecting some pain with JPA, which is my next step.