Hi,
Another possible workaround is to use Spring's SimpleDriverDataSource to
directly instantiate an "unpooled" datasource and then instantiate a
"pooled" one through C3P0 DataSources' factory methods.
Regards
On Tue, Oct 26, 2010 at 13:57, Jean-Baptiste Onofré <[email protected]> wrote:
> 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
>>
>