camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lekkie <lekkie.ay...@gmail.com>
Subject Re: Class not found exception when trying to load class with Class.forName("")
Date Thu, 11 Feb 2010 15:56:32 GMT

I tried that and it still did not work.

My import package lookslike:

<Import-Package>
            				javax.jws,javax.wsdl,
            				META-INF.cxf,
            				META-INF.cxf.transport.nmr,
                          	org.apache.cxf.bus,
                          	org.apache.servicemix.camel.nmr,
                          	org.apache.servicemix.cxf.transport.nmr,
                          	org.apache.servicemix.nmr.api,
                          	org.apache.servicemix.nmr.api.event,
                          	org.apache.servicemix.nmr.api.internal, 
                          	org.springframework.beans.factory.config,
                          	net.sourceforge.jtds.jdbc.Driver,
                          	*
            </Import-Package>

I noticed my bundle's manifest has the version has 1.2 instead of 1.2.2, see
manifest below:

META-INF.cxf,META-INF.cxf.transport.nmr,com.mchange.
 v2.c3p0,javax.jws,javax.wsdl,javax.xml.bind,javax.xml.bind.annotation
 ,javax.xml.parsers,net.sourceforge.jtds.jdbc.Driver;version="1.2",org
 .apache.camel;version="2.0",org.apache.commons.logging,org.apache.cxf
 .bus,org.apache.servicemix.camel.nmr,org.apache.servicemix.cxf.transp
 ort.nmr,org.apache.servicemix.nmr.api,org.apache.servicemix.nmr.api.e
 vent,org.apache.servicemix.nmr.api.internal,org.springframework.beans
 .factory.config,org.w3c.dom,org.xml.sax




Ashwin Karpe wrote:
> 
> Hi,
> 
> If the driver is a plain old jar it is possible to deploy it as such using
> the wrap protocol for example
>   wrap:mvn:mygroupId/myartifactId/1.1 instead of handcrafting a manifest
> entry... You need to install it in the maven repository first.
> 
> If the jar can be installed correctly and shows up as installed when you
> do an "osgi/list" in Servicemix4.x
> you can try
>      <Import-Package>
>            net.sourceforge.jtds.jdbc.Driver;version=1.2.2,
>            *
>      </Import-Package>
> 
> Not sure why the DynamicImport does not work but the Import Package has
> the same effect while offering ore control.
> 
> Hope this helps.
> 
> Cheers,
> 
> Ashwin...
> 
> 
> lekkie wrote:
>> 
>> Hi guys,
>> 
>> I am trying to use spring to manage datasource and I am using
>> com.mchange.v2.c3p0.DriverManager.
>> 
>> I set my dynamicimport package to asterisk as shown below:
>> <DynamicImport-Package>*</DynamicImport-Package>
>> 
>> I have mssqlserver driver all in one (net.sourceforge.jtds) added as a
>> bundle, installed in servicemix with the ffg manifest:
>> 
>> Manifest-Version = 1.0
>> Ant-Version = Apache Ant 1.6.1
>> Created-By = 1.3.1_08-b03 (Sun Microsystems Inc.)
>> Implementation-Title = jTDS JDBC Driver
>> Implementation-Version = 1.2.2
>> Implementation-URL = http://jtds.sourceforge.net
>> Specification-Title = JDBC
>> Specification-Version = 3.0
>> Export-Package = net.sourceforge.jtds.jdbc.Driver;version="1.2.2"
>> Main-Class = net.sourceforge.jtds.jdbc.Driver
>> Class-Path = jcifs.jar
>> 
>> Each time I try to use the datasource it throws the ffg exception:
>> 
>> 09:53:16,158 | WARN  | er$PoolThread-#0 | DriverManagerDataSource         
>> | 14logging.Jdk14MLog$Jdk14MLogger  148 | Could not load driverClass
>> net.sourceforge.jtds.jdbc.Driver
>> java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver
>> 	at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:494)
>> 	at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
>> 	at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:398)
>> 	at
>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
>> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>> 	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>> 	at java.lang.Class.forName0(Native Method)
>> 	at java.lang.Class.forName(Class.java:164)
>> 	at
>> com.mchange.v2.c3p0.DriverManagerDataSource.ensureDriverLoaded(DriverManagerDataSource.java:100)
>> 	at
>> com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:132)
>> 	at
>> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
>> 	at
>> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
>> 	at
>> com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
>> 	at
>> com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
>> 	at
>> com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
>> 	at
>> com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
>> 	at
>> com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
>> 
>> What am I doin wrong?
>> 
>> kr.
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Class-not-found-exception-when-trying-to-load-class-with-Class.forName%28%22%22%29-tp27544168p27549197.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message