We have a "common" library where we export all of the necessary Oracle packages
into the container. This is deployed prior to the bundle using hibernate. I
wonder if this is a wiring issue, perhaps the bundle using hibernate isn't
wiring to the Oracle package when it needs to.?? Dunno, its causing some major
headaches though.
I've been looking into creating a fragment, but haven't seen any good tutorials
on this. When you say " gather bundles in the same classloader", how would
that work? I've seen this referenced in the past.
v/r,
Mike Van
----- Original Message -----
From: "Jean-Baptiste Onofré [via Karaf]"
<[email protected]>
To: "Mike Van" <[email protected]>
Sent: Tuesday, October 26, 2010 11:54:39 AM
Subject: Re: Karaf Spring C3P0 issue
Hi Mike,
I guess that you made a "wrapper" bundle for the Oracle JDBC driver.
Could you check if the JDBC driver is well deployed using osgi:list
command ?
A package:export command execution could be fine to see the exported
packages.
If the JDBC driver bundle is deployed, I think that the C3P0 code try
something like
Class.forName("oracle.jdbc.driver.OracleDriver").
The problem is the Oracle JDBC driver is certainly not in the class
classloader (due to OSGi "dynamism").
A possible workaround is to use Bundle Fragment to gather bundles in the
same classloader.
Regards
JB
On 10/26/2010 05:46 PM, Mike Van wrote:
>
> All,
>
> I posted this initially on the Springsource forums, as I'm using thier
> bundles to implement Hibernate within Karaf. Unfortunately, there have been
> not replies. Since this is also a Karaf issue, I thought I'd ask you folks
> for some assistance also.
>
> I'm deploying a bundle into Karaf 2.0.0 that makes use of Spring and C3P0
> (the com.springsource version of C3P0), and I'm getting the following error:
>
> com.springsource.com.mchange.v2.c3p0 - 0.9.1.2 | Could not load driverClass
> oracle.jdbc.driver.OracleDriver.
> java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
> at
> org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:772)
>
> at org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73)
> at
> org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1685)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)[:1.6.0_18]
> at java.lang.Class.forName0(Native Method)[1.6.0_18]
> at java.lang.Class.forName(Class.java:169)[:1.6.0_18]
> at
> com.mchange.v2.c3p0.DriverManagerDataSource:ensureDriverLoaded(DriverManagerDataSource.java:100)[53:com.springsource.com.mchange.v2.c3p0:0.9.1.2]
>
>
> Now, the bundle in question does import oracle.jdbc.driver.OracleDriver, and
> in the MANIFEST.MF file "Dynamic-Import" is set to "*". Additionally, when I
> run the following command inside of karaf:
> osgi:list | grep oracle
>
> the oracle.jdbc.driver package is available within Karaf.
>
> Does anyone know what is going on here?
>
>
> v/r,
>
> Mike Van
View message @
http://karaf.922171.n3.nabble.com/Karaf-Spring-C3P0-issue-tp1774535p1774580.html
To start a new topic under Karaf - User, email
[email protected]
To unsubscribe from Karaf - User, click here .
--
View this message in context:
http://karaf.922171.n3.nabble.com/Karaf-Spring-C3P0-issue-tp1774535p1774668.html
Sent from the Karaf - User mailing list archive at Nabble.com.