<!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;">
    JBoss AS 7.1.0 not working with OCI driver
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/sridharts">sridharts</a> in <i>JBoss AS 7 Development</i> - <a href="https://community.jboss.org/message/752703#752703">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi,</p><p>&#160; I have Jboss AS 4.05 currently and am migrating to JBoss AS 7.1.0. I installed Jboss7.1.0 and did the setup and everything works fine except the jdbc driver. </p><p>I have downloaded the instantclient from oracle website for oralce 11g (1.2.0.1.0)&#160; in <span style="color: #0000ff;">C:\ple\instantclient</span> folder which has the ojdbc6.jar and ocijdbc11.dll and other dlls . My oracle database is in a different machine and its the same version(11.2.0.1.0.)&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I created a simple java program which does these things and it works fine and returns the results without any error. </p><p>&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #0000ff;">String driverClass = "oracle.jdbc.driver.OracleDriver";</span></p><p><span style="color: #0000ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; String connectString = "jdbc:oracle:oci:@sridb:1521:intpl";</span></p><p><span style="color: #0000ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; String userName = "myuser";</span></p><p><span style="color: #0000ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; String password = "mypass";</span></p><p><span style="color: #0000ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; String sql = "select count(id) from mytesttable";</span></p><p>&#160;&#160;&#160;&#160;&#160;&#160; </p><p><span style="color: #0000ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; Class.forName(driverClass);</span></p><p><span style="color: #ff0000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; cont = DriverManager.getConnection(connectString, userName, password);</span></p><p><span style="color: #0000ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; Statement stmt =&#160; cont.createStatement(sql);</span></p><p><span style="color: #0000ff;">&#160;&#160;&#160;&#160;&#160;&#160; stmt.executeQuery();</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>But when i do the exact same thing from a jsp inside the Jboss 7.1.0 server it doesnt work and gives a sql exception in DriverManager.getConnection() with no trace or detail message.</p><p>All the detailed message the SQLException had was some 4 wierd square shaped characters and those characters keeps changing too everytime i run it.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #ff0000;">This same thing works fine with my Jboss 4.05 server with the oci driver. The other thing i noticed was if i changed the driver to thin in my connectString (jdbc:oracle:thin:@sridb:1521:intpl) it works fine. </span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #339966; text-decoration: underline;"><strong>Has anyone encountered this similar issue. Any help in this is appreciated.</strong></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>In my jboss standalone.bat i set the classpath and path as</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #0000ff;">set CLASSPATH=%CLASSPATH%;C:\ple\instantclient\ojdbc6.jar</span></p><p><span style="color: #0000ff;">set PATH=C:\ple\instantclient;%PATH%</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>In modules folder i created com/myoracle/main folders and copied into it the C:\ple\instantclient\ojdbc6.jar</p><p>also created a dlls folder under main and copied all the dlls from C:\ple\instantclient</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This is how my module.xml looks like</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #3366ff;">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</span></p><p><span style="color: #3366ff;">&lt;module xmlns="urn:jboss:module:1.0" name="com.myoracle"&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160; &lt;resources&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160; &lt;resource-root path="dlls"/&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;resource-root path="ojdbc6.jar"/&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160; &lt;/resources&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160; &lt;dependencies&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module name="javax.api"/&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module name="javax.transaction.api"/&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160; &lt;/dependencies&gt;</span></p><p><span style="color: #3366ff;">&lt;/module&gt;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>In my test.war/WEB-INF this is my jboss-deployment-structure.xml</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #3366ff;">&lt;jboss-deployment-structure&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160; &lt;deployment&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- Exclusions allow you to prevent the server from automatically adding some dependencies --&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;exclusions&gt;</span></p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/exclusions&gt;&#160;&#160;&#160; </span></p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dependencies&gt;</span></p><p><span style="color: #3366ff;">&#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; &lt;module name="com.myoracle" /&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&lt;/dependencies&gt;&#160; </span></p><p><span style="color: #3366ff;">&#160;&#160;&#160; &lt;/deployment&gt;</span></p><p><span style="color: #3366ff;">&lt;/jboss-deployment-structure&gt;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #000000;">I also tried it with giving a datasource in standalone.xml l and accessing it in my jsp with the datasource name. But get the same issue. It works only if i use thin but not oci.</span></p><p><span style="color: #3366ff;"> &lt;subsystem xmlns="urn:jboss:domain:datasources:1.0"&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;datasources&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;datasource jta="true" jndi-name="java:/OracleDS" pool-name="OracleDS" enabled="true" use-java-context="true"&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;connection-url&gt;jdbc:oracle:oci:@sdqa11:1521:intpl&lt;/connection-url&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;driver&gt;plejdbc&lt;/driver&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;security&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;user-name&gt;nielsen_claritas&lt;/user-name&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;password&gt;f00sball&lt;/password&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/security&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/datasource&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;drivers&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;driver name="plejdbc" module="com.nielsen.oraclejdbc"&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xa-datasource-class&gt;oracle.jdbc.xa.client.OracleXADataSource&lt;/xa-datasource-class&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/driver&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/drivers&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/datasources&gt;</span></p><p><span style="color: #3366ff;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/subsystem&gt;</span></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/752703#752703">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss AS 7 Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


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

</div>

</body>
</html>