5 Replies Latest reply on Feb 14, 2012 10:42 AM by Joseph Fouts

    Wrong Driver Class - Is this a JBoss 7 bug?

    Joseph Fouts Novice

      Had this posted in the datasource forum but no replies.


      Can one of the JBoss 7 experts take a look at the following and tell me if this could be a JBoss 7 bug?



      Trying to get db2 univeral type 4 driver to work with jboss 7.1.0.CR1b.

      Setup db2 driver as a module.  Seems to setup fine but when a sample program tries to do

      a connection I get the following:



      Caused by: javax.resource.ResourceException: Wrong driver class [class com.ibm.db2.jcc.DB2Driver] for this connection URL [jdbc:db2//]

          at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:251)




      DB2 Version 8.1.8  fix pack 8 (db2 server)


      Used jar files from IBM/SQLLIB/java

      db2jcc - version 2.5



      Running Windows 7 64 bit




      Setup db2 driver as module:




      Created module.xml file:


      <?xml version="1.0" encoding="UTF-8"?>


        ~ This file will define the DB2 database driver and any

        ~ dependencies.


      <module xmlns="urn:jboss:module:1.1" name="com.ibm.db2">


          <resource-root path="db2jcc.jar"/>

          <resource-root path="db2jcc_license_cu.jar"/>



          <module name="javax.api"/>

          <module name="javax.transaction.api"/>

          <module name="sun.jdk"/>






      Verifed database IP/Port/Name







      Added db2 datasource to standalone.xml



                  <datasource jndi-name="java:/admindatasource" pool-name="admindatasource" enabled="true" jta="true" use-java-context="true" use-ccm="true">
                      <driver name="db2jcc" module="com.ibm.db2">




      Java code connection:


              InitialContext ic = new InitialContext();

              DataSource ds = (DataSource)ic.lookup("java:/admindatasource");

              Connection con = ds.getConnection();





      When starting standalone server get the following log messages:

      (See that the db2 driver is deployed and that the "admindatsource" is Bound


      13:00:15,404 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 26) JBAS010403: Deploying JDBC-compliant driver class com.ibm.db2.jcc.DB2Driver (version 2.5)

      13:00:15,430 INFO  [org.jboss.as.remoting] (MSC service thread 1-5) Listening on /

      13:00:15,932 INFO  [org.jboss.as.remoting] (MSC service thread 1-6) Listening on /

      13:00:15,969 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) JBAS015012: Started FileSystemDeploymentService for directory C:\apps\jboss-as-7.1.0.CR1b\standalone\deployments

      13:00:16,388 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:/admindatasource]






      I read the doc on classloading issues several times and it seems that I have everythings setup the way that JBoss wants.


      So does anyone have any ideas on why I might be getting this error?


      Any help is greatly appreciated.