Sunday, 26 April 2015

Textual description of firstImageUrl

Driver Class Not Found Error In MULE

If you use mule built in C3P0 data connection pool to connect to databse , it throws ClassNotFoundException even if the driver class is present in MULE_HOME/APPS/{YOUR_APP}/lib directory .

com.mchange.v2.c3p0.DriverManagerDataSource - WARN - Could not load driverClass
 at$ Source)
 at$ Source)
 at Method)
 at Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Unknown Source)
 at com.mchange.v2.c3p0.DriverManagerDataSource.ensureDriverLoaded(
 at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(
 at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(
 at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(
 at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(
 at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(
 at com.mchange.v2.resourcepool.BasicResourcePool.access$800(
 at com.mchange.v2.resourcepool.BasicResourcePool$
 at com.mchange.v2.async.ThreadPoolAsynchronousRunner$
So if you use database connector configuration or create a separate spring bean for C3P0 datasource , it will not work .This is known bug . If you are using mule 3.5.0 , you might face this error . Solution :

1 ) Put your Driver class Jar file in MULE_HOME/lib folder instead of your app folder .
2 ) Use some other datasource like CommonsDBCP .
Post Comments And Suggestions !!