title: Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver' in JBoss Fuse
body: <p>I develop a bundle under JBoss Fuse which persists some data into DB. My DAO failes to initialize connection pool to the Oracle DB due to exception:</p>
  
  <blockquote>
    <p>Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load
    JDBC driver class 'oracle.jdbc.driver.OracleDriver'</p>
    
    <p>at
    org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1429)</p>
    
    <p>at
    org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)</p>
    
    <p>at
    org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)</p>
    
    <p>at
    bank.dao.CorrelationInfoDaoImpl.insertCorellationInfo(CorrelationInfoDaoImpl.java:25)</p>
    
    <p>... 28 more</p>
    
    <p>Caused by: java.lang.ClassNotFoundException:
    oracle.jdbc.driver.OracleDriver not found by io.fabric8.fabric-jolokia
    [98]</p>
  </blockquote>
  
  <p>Neither 
  <code>&lt;DynamicImport-Package&gt;oracle.jdbc.driver.OracleDriver&lt;/DynamicImport-Package&gt;</code>
  , nor artifact <code>wrap:mvn:com.oracle.jdbc/ojdbc7/12.1.0.2</code> inclusion, nor bean declaration at Blueprint descriptor 
  <code>&lt;bean id="dictDS-driver-class-name" class="oracle.jdbc.driver.OracleDriver"/&gt;</code> does not help. Could anyone give an idea, how to solve it?</p>
  
  <p>Here is pom.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;bank&lt;/groupId&gt;
      &lt;artifactId&gt;AdpFMOutConcurrent&lt;/artifactId&gt;
      &lt;packaging&gt;bundle&lt;/packaging&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
          &lt;maven-bundle-plugin.version&gt;3.2.0&lt;/maven-bundle-plugin.version&gt;
          &lt;maven-resources-plugin.version&gt;3.0.1&lt;/maven-resources-plugin.version&gt;
          &lt;maven-compiler-plugin.version&gt;3.5.1&lt;/maven-compiler-plugin.version&gt;
          &lt;camel-maven-plugin-version&gt;2.15.1.redhat-621084&lt;/camel-maven-plugin-version&gt;
          &lt;fabric8-maven-plugin-version&gt;1.2.0.redhat-621084&lt;/fabric8-maven-plugin-version&gt;
          &lt;jboss.fuse.bom.version&gt;6.2.1.redhat-084&lt;/jboss.fuse.bom.version&gt;
          &lt;datamodel.version&gt;1.0-SNAPSHOT&lt;/datamodel.version&gt;
          &lt;ojdbc7.version&gt;12.1.0.2&lt;/ojdbc7.version&gt;
          &lt;junit.version&gt;4.12&lt;/junit.version&gt;
      &lt;/properties&gt;   
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.jboss.fuse.bom&lt;/groupId&gt;
                  &lt;artifactId&gt;jboss-fuse-parent&lt;/artifactId&gt;
                  &lt;version&gt;${jboss.fuse.bom.version}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;dependencies&gt;
          &lt;!-- Custom --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;bank&lt;/groupId&gt;
              &lt;artifactId&gt;DataModel&lt;/artifactId&gt;
              &lt;version&gt;${datamodel.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Camel --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-core&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-blueprint&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;!-- The ActiveMQ client with connection pooling --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
              &lt;artifactId&gt;activemq-client&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
              &lt;artifactId&gt;activemq-camel&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
              &lt;artifactId&gt;activemq-pool&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;!-- DB --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.oracle.jdbc&lt;/groupId&gt;
              &lt;artifactId&gt;ojdbc7&lt;/artifactId&gt;
              &lt;version&gt;${ojdbc7.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-jdbc&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
              &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Logging --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Testing --&gt;
          &lt;!-- https://mvnrepository.com/artifact/junit/junit --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;${junit.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
  
      &lt;build&gt;
          &lt;resources&gt;
              &lt;resource&gt;
                  &lt;directory&gt;${basedir}/target/generated-sources/resources&lt;/directory&gt;
              &lt;/resource&gt;
              &lt;resource&gt;
                  &lt;directory&gt;${basedir}/src/main/resources&lt;/directory&gt;
              &lt;/resource&gt;
          &lt;/resources&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${maven-compiler-plugin.version}&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${maven-resources-plugin.version}&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;encoding&gt;UTF-8&lt;/encoding&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${maven-bundle-plugin.version}&lt;/version&gt;
                  &lt;extensions&gt;true&lt;/extensions&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;bundle-manifest&lt;/id&gt;
                          &lt;phase&gt;process-classes&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;manifest&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;instructions&gt;
                          &lt;Bundle-SymbolicName&gt;${project.groupId}.${project.artifactId}&lt;/Bundle-SymbolicName&gt;
                          &lt;Private-Package&gt;bank.*&lt;/Private-Package&gt;
                          &lt;Import-Package&gt;*&lt;/Import-Package&gt;
                          &lt;DynamicImport-Package&gt;oracle.jdbc.driver.OracleDriver&lt;/DynamicImport-Package&gt;
                      &lt;/instructions&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
                  &lt;artifactId&gt;camel-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${camel-maven-plugin-version}&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;useBlueprint&gt;true&lt;/useBlueprint&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;io.fabric8&lt;/groupId&gt;
                  &lt;artifactId&gt;fabric8-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${fabric8-maven-plugin-version}&lt;/version&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;unpack-xsd-files&lt;/id&gt;
                          &lt;phase&gt;initialize&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;unpack&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;artifactItems&gt;
                                  &lt;artifactItem&gt;
                                      &lt;groupId&gt;bank&lt;/groupId&gt;
                                      &lt;artifactId&gt;DataModel&lt;/artifactId&gt;
                                      &lt;version&gt;${project.version}&lt;/version&gt;
                                      &lt;type&gt;bundle&lt;/type&gt;
                                  &lt;/artifactItem&gt;
                              &lt;/artifactItems&gt;
                              &lt;includes&gt;
                                  ASBOFMOut/*.xsd,
                                  GBOCommon/*.xsd,
                                  ASBOFMDataModel/*.xsd
                              &lt;/includes&gt;
                              &lt;outputDirectory&gt;${basedir}/target/generated-sources/resources/model&lt;/outputDirectory&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
  
              &lt;!-- JAXB xjc plugin that invokes the xjc compiler to compile XML schema into Java classes.--&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                  &lt;artifactId&gt;jaxb2-maven-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;xjc&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;!-- The schema directory or xsd files. --&gt;
                      &lt;sources&gt;
                          &lt;source&gt;${basedir}/target/generated-sources/resources/model&lt;/source&gt;
                      &lt;/sources&gt;
                      &lt;xjbSources&gt;
                          &lt;xjbSource&gt;${basedir}/src/main/resources/jaxbBinding.xjb&lt;/xjbSource&gt;
                      &lt;/xjbSources&gt;
                      &lt;xjcSourceExcludeFilters&gt;
                          &lt;filter implementation="org.codehaus.mojo.jaxb2.shared.filters.pattern.PatternFileFilter"&gt;
                              &lt;patterns&gt;
                                  &lt;pattern&gt;\.svn.*&lt;/pattern&gt;
                              &lt;/patterns&gt;
                          &lt;/filter&gt;
                      &lt;/xjcSourceExcludeFilters&gt;
                      &lt;outputDirectory&gt;${basedir}/target/generated-sources/jaxb&lt;/outputDirectory&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>Here is Blueprint descriptor:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
             xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd          http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd"&gt;
  
      &lt;cm:property-placeholder id="adpfmoutconcurrent" persistent-id="adpfmoutconcurrent"&gt;
          &lt;cm:default-properties&gt;
              &lt;cm:property name="broker.url" value="discovery:(fabric:public)"/&gt;
              &lt;cm:property name="broker.username" value="admin"/&gt;
              &lt;cm:property name="broker.password" value="admin"/&gt;
  
              &lt;cm:property name="max.connections" value="5"/&gt;
              &lt;cm:property name="concurrent.consumers" value="10"/&gt;
              &lt;cm:property name="max.concurrent.consumers" value="15"/&gt;
  
              &lt;cm:property name="persistence.driver" value="oracle.jdbc.driver.OracleDriver"/&gt;
              &lt;cm:property name="persistence.url" value="jdbc:oracle:thin:@10.10.3.42:1521:ESBDB"/&gt;
              &lt;cm:property name="persistence.username" value="esb_db_dev3"/&gt;
              &lt;cm:property name="persistence.password" value="esb_db_dev3"/&gt;
          &lt;/cm:default-properties&gt;
      &lt;/cm:property-placeholder&gt;
  
      &lt;bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"&gt;
          &lt;property name="brokerURL" value="${broker.url}"/&gt;
          &lt;property name="userName" value="${broker.username}"/&gt;
          &lt;property name="password" value="${broker.password}"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="pooledJmsConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory"&gt;
          &lt;property name="maxConnections" value="${max.connections}"/&gt;
          &lt;property name="connectionFactory" ref="jmsConnectionFactory"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="jmsCamelConfig" class="org.apache.camel.component.jms.JmsConfiguration"&gt;
          &lt;property name="connectionFactory" ref="pooledJmsConnectionFactory"/&gt;
          &lt;property name="transacted" value="false"/&gt;
          &lt;property name="concurrentConsumers" value="${concurrent.consumers}"/&gt;
          &lt;property name="maxConcurrentConsumers" value="${max.concurrent.consumers}"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="publicamq" class="org.apache.activemq.camel.component.ActiveMQComponent"&gt;
          &lt;property name="configuration" ref="jmsCamelConfig"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
          &lt;property name="driverClassName" value="${persistence.driver}"/&gt;
          &lt;property name="url" value="${persistence.url}"/&gt;
          &lt;property name="username" value="${persistence.username}"/&gt;
          &lt;property name="password" value="${persistence.password}"/&gt;
          &lt;property name="minIdle" value="5"/&gt;
          &lt;property name="validationQuery" value="select 1 from dual"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="correlationInfoDao" class="bank.dao.CorrelationInfoDaoImpl"&gt;
          &lt;property name="dataSource" ref="dataSource"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="correlationInfoPersister" class="bank.processor.CorrelationInfoPersister"&gt;
          &lt;property name="correlationInfoDao" ref="correlationInfoDao"/&gt;
      &lt;/bean&gt;
  
      &lt;camelContext id="adpfmoutconcurrent-context" xmlns="http://camel.apache.org/schema/blueprint"&gt;
          &lt;package&gt;bank.route&lt;/package&gt;
          &lt;dataFormats&gt;
              &lt;jaxb id="asbofmout" prettyPrint="true" contextPath="bank.asbofmout"/&gt;
          &lt;/dataFormats&gt;
      &lt;/camelContext&gt;
  &lt;/blueprint&gt;
  </code></pre>