Hi Stephen,

How do you use DBCP ? Via pax-jdbc, blueprint, your own bundle ?

If you use in your bundle, you probably need to set the Thread Context Class Loader (TCCL).

Regards
JB

On 07/04/2017 11:35 PM, smunro wrote:
Hello,

I've got a question regarding DBCP2 & Karaf.   When using DBCP2, I get a
driver not found error. If I use a straight Class.forName("org.h2.Driver")
it works as expected. I'm not looking to use fragments at the moment as I
need to get a working example quickly, but before I bin all the DBCP2 code I
have, does anyone know of a quick way to get the above working.

I've tried the DynamicImport-Package entry (which doesn't appear to appear
in intellisense as an option when adding it to the maven plugin). And while
the bundle does book up, none of the breakpoints are hit when running in
debug mode (when I take it out, the break points are hit), so I'm guessing
this isn't supported.

Can anyone suggest a quick way to get the DBCP2 BasicDataSource to work
correctly in an osgi bundle without it throwing an exception that it cannot
locate the driver. I know it's a classpath issue with the current thread,
I'm just looking for a fast way to get around it before moving onto a more
long term solution.

Stephen



--
View this message in context: 
http://karaf.922171.n3.nabble.com/DBCP2-Karaf-tp4050942.html
Sent from the Karaf - User mailing list archive at Nabble.com.


--
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to