Uploaded image for project: 'Database Connector'
  1. Database Connector
  2. DBCON-16

DB connector fails to create a pooled connection when DB driver is deployed in the mule application

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Severity:
      S1
    • Defect Source:
      Production Defect
    • Story Points:
      5
    • Configuration:
      Hide

      <?xml version="1.0" encoding="UTF-8"?>
      <mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:db="http://www.mulesoft.org/schema/mule/db"
      xmlns:http="http://www.mulesoft.org/schema/mule/http"
      xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
      http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
      http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">

      <db:mysql-config name="dbConfig" url="jdbc:mysql://localhost:3306/test">
      <db:pooling-profile maxPoolSize="1" minPoolSize="0" maxWaitMillis="1"/>
      </db:mysql-config>

      <flow name="defaultQueryRequestResponse">
      <inbound-endpoint address="http://localhost:8081" exchange-pattern="request-response" />

      <db:select config-ref="dbConfig">
      <db:parameterized-query>select * from PLANET order by ID</db:parameterized-query>
      </db:select>
      </flow>
      </mule>

      Show
      <?xml version="1.0" encoding="UTF-8"?> <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns:http="http://www.mulesoft.org/schema/mule/http" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd "> <db:mysql-config name="dbConfig" url="jdbc:mysql://localhost:3306/test"> <db:pooling-profile maxPoolSize="1" minPoolSize="0" maxWaitMillis="1"/> </db:mysql-config> <flow name="defaultQueryRequestResponse"> <inbound-endpoint address="http://localhost:8081" exchange-pattern="request-response" /> <db:select config-ref="dbConfig"> <db:parameterized-query>select * from PLANET order by ID</db:parameterized-query> </db:select> </flow> </mule>
    • Log Output:
      Hide
      WARN 2014-06-30 12:13:39,136 [C3P0PooledConnectionPoolManager[identityToken->1hge15x921tup3ve53muvt|321ea24]-HelperThread-#2] com.mchange.v2.c3p0.DriverManagerDataSource: Could not load driverClass com.mysql.jdbc.Driver
      java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:171)
      at com.mchange.v2.c3p0.DriverManagerDataSource.ensureDriverLoaded(DriverManagerDataSource.java:140)
      at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:156)
      at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:161)
      at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:147)
      at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200)
      at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1086)
      at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073)
      at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44)
      at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1814)
      at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
      Show
      WARN 2014-06-30 12:13:39,136 [C3P0PooledConnectionPoolManager[identityToken->1hge15x921tup3ve53muvt|321ea24]-HelperThread-#2] com.mchange.v2.c3p0.DriverManagerDataSource: Could not load driverClass com.mysql.jdbc.Driver java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:171) at com.mchange.v2.c3p0.DriverManagerDataSource.ensureDriverLoaded(DriverManagerDataSource.java:140) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:156) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:161) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:147) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1086) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1814) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
    • Sprint:
      ESB Fitz Roy 5

      Description

      DB connector uses C3P0 in order to provide connection pooling.
      When a pooling profile is used, the driver must be deployed on the mule server, otherwise the pool will be unable to create connections.

      To reproduce, create an application with the attached config and copy the mysql driver inside the app/lib folder. Then hit http://localhost:8081 and get the attached exception.

        Attachments

          Activity

            People

            Assignee:
            pablo.kraan@mulesoft.com Pablo Kraan Brun
            Reporter:
            pablo.kraan@mulesoft.com Pablo Kraan Brun
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved:

                PagerDuty