<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Wrong driver class [class comm.ibm.db2.jcc.db2Driver]
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/foutjo">Joseph Fouts</a> in <i>Datasource Configuration</i> - <a href="https://community.jboss.org/message/716299#716299">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Trying to get db2 univeral type 4 driver to work with jboss 7.1 and keep getting :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Caused by: javax.resource.ResourceException: Wrong driver class [class com.ibm.db2.jcc.DB2Driver] for this connection URL [jdbc:db2//10.90.10.125/apdev70:60009]</p><p>&#160;&#160;&#160; at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:251)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>---------------------------------------------------------------------------</p><p>DB2 Version 8.1</p><p>Used jar files from IBM/SQLLIB/java</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>--------------------------------------------------------------------------</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Setup db2 driver as module:</p><p>modules/com/ibm/db2/main/db2jcc.jar</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; /db2jcc_license_cu</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Created module.xml file:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</p><p> &lt;!--</p><p>&#160; ~ This file will define the DB2 database driver and any</p><p>&#160; ~ dependencies.</p><p>&#160; --&gt;</p><p> &lt;module xmlns="urn:jboss:module:1.1" name="com.ibm.db2"&gt;</p><p>&#160; &lt;resources&gt;</p><p>&#160;&#160;&#160; &lt;resource-root path="db2jcc.jar"/&gt;</p><p>&#160;&#160;&#160; &lt;resource-root path="db2jcc_license_cu.jar"/&gt;</p><p>&#160; &lt;/resources&gt;</p><p>&#160; &lt;dependencies&gt;</p><p>&#160;&#160;&#160; &lt;module name="javax.api"/&gt;</p><p>&#160;&#160;&#160; &lt;module name="javax.transaction.api"/&gt;</p><p>&#160;&#160;&#160; &lt;module name="sun.jdk"/&gt;</p><p>&#160; &lt;/dependencies&gt;</p><p>&lt;/module&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>-----------------------------------------------------------------------------------</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Verifed database IP/Port/Name</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>10.90.10.125</p><p>60009</p><p>apdev70</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>------------------------------------------------------------------------------------</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Added db2 datasource to standalone.xml</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><table><tbody><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;datasources&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;datasource jndi-name="java:/admindatasource" pool-name="admindatasource" enabled="true" jta="true" use-java-context="true" use-ccm="true"&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;connection-url&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">jdbc:db2//10.90.10.125/apdev70:60009</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;/connection-url&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;driver&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">db2jcc</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;/driver&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;timeout&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;idle-timeout-minutes&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">0</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;/idle-timeout-minutes&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;query-timeout&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">600</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;/query-timeout&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;/timeout&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;/datasource&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;drivers&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;driver name="db2jcc" module="com.ibm.db2"&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;driver-class&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">com.ibm.db2.jcc.DB2Driver</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;/driver-class&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;/driver&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;/drivers&gt;</td></tr><tr><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </td><td style=";">&lt;/datasources&gt;</td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>--------------------------------------------------------------------------------------------------------</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Java code connection:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; InitialContext ic = new InitialContext();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; DataSource ds = (DataSource)ic.lookup("java:/admindatasource");</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; Connection con = ds.getConnection();</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>_____________________________________________________________</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>When starting standalone server get the following log messages:</p><p>(See that the db2 driver is deployed and that the "admindatsource" is Bound</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>13:00:15,404 INFO&#160; [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 26) JBAS010403: Deploying JDBC-compliant driver class com.ibm.db2.jcc.DB2Driver (version 2.11)</p><p>13:00:15,430 INFO&#160; [org.jboss.as.remoting] (MSC service thread 1-5) Listening on /10.100.100.12:4447</p><p>13:00:15,932 INFO&#160; [org.jboss.as.remoting] (MSC service thread 1-6) Listening on /10.100.100.12:9999</p><p>13:00:15,969 INFO&#160; [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</p><p>13:00:16,388 INFO&#160; [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:/admindatasource]</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>------------------------------------------------------------------------------------------------------</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>So any ideas on why I am getting the following error when trying to make a connection?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Any help is greatly appreciated.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/716299#716299">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Datasource Configuration at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>