<!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>  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)  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.)  </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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>       <span style="color: #0000ff;">String driverClass = "oracle.jdbc.driver.OracleDriver";</span></p><p><span style="color: #0000ff;">        String connectString = "jdbc:oracle:oci:@sridb:1521:intpl";</span></p><p><span style="color: #0000ff;">        String userName = "myuser";</span></p><p><span style="color: #0000ff;">        String password = "mypass";</span></p><p><span style="color: #0000ff;">         String sql = "select count(id) from mytesttable";</span></p><p>       </p><p><span style="color: #0000ff;">        Class.forName(driverClass);</span></p><p><span style="color: #ff0000;">        cont = DriverManager.getConnection(connectString, userName, password);</span></p><p><span style="color: #0000ff;">        Statement stmt =  cont.createStatement(sql);</span></p><p><span style="color: #0000ff;">       stmt.executeQuery();</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </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;"> </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;"> </p><p>In my jboss standalone.bat i set the classpath and path as</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </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;"> </p><p>This is how my module.xml looks like</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="color: #3366ff;"><?xml version="1.0" encoding="UTF-8"?></span></p><p><span style="color: #3366ff;"><module xmlns="urn:jboss:module:1.0" name="com.myoracle"></span></p><p><span style="color: #3366ff;">    <resources></span></p><p><span style="color: #3366ff;">      <resource-root path="dlls"/></span></p><p><span style="color: #3366ff;">        <resource-root path="ojdbc6.jar"/></span></p><p><span style="color: #3366ff;">    </resources></span></p><p><span style="color: #3366ff;">    <dependencies></span></p><p><span style="color: #3366ff;">        <module name="javax.api"/></span></p><p><span style="color: #3366ff;">        <module name="javax.transaction.api"/></span></p><p><span style="color: #3366ff;">    </dependencies></span></p><p><span style="color: #3366ff;"></module></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </p><p><span style="color: #3366ff;"><jboss-deployment-structure></span></p><p><span style="color: #3366ff;">    <deployment></span></p><p><span style="color: #3366ff;">        <!-- Exclusions allow you to prevent the server from automatically adding some dependencies --></span></p><p><span style="color: #3366ff;">        <exclusions></span></p><p>            </p><p><span style="color: #3366ff;">        </exclusions>    </span></p><p>        </p><p><span style="color: #3366ff;">        <dependencies></span></p><p><span style="color: #3366ff;">                                <module name="com.myoracle" /></span></p><p><span style="color: #3366ff;">                    </dependencies>  </span></p><p><span style="color: #3366ff;">    </deployment></span></p><p><span style="color: #3366ff;"></jboss-deployment-structure></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> <subsystem xmlns="urn:jboss:domain:datasources:1.0"></span></p><p><span style="color: #3366ff;">            <datasources></span></p><p><span style="color: #3366ff;">                <datasource jta="true" jndi-name="java:/OracleDS" pool-name="OracleDS" enabled="true" use-java-context="true"></span></p><p><span style="color: #3366ff;">                    <connection-url>jdbc:oracle:oci:@sdqa11:1521:intpl</connection-url></span></p><p><span style="color: #3366ff;">                    <driver>plejdbc</driver></span></p><p><span style="color: #3366ff;">                    <security></span></p><p><span style="color: #3366ff;">                        <user-name>nielsen_claritas</user-name></span></p><p><span style="color: #3366ff;">                        <password>f00sball</password></span></p><p><span style="color: #3366ff;">                    </security></span></p><p><span style="color: #3366ff;">                </datasource></span></p><p><span style="color: #3366ff;">                <drivers></span></p><p><span style="color: #3366ff;">                    <driver name="plejdbc" module="com.nielsen.oraclejdbc"></span></p><p><span style="color: #3366ff;">                        <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class></span></p><p><span style="color: #3366ff;">                    </driver></span></p><p><span style="color: #3366ff;">                </drivers></span></p><p><span style="color: #3366ff;">            </datasources></span></p><p><span style="color: #3366ff;">        </subsystem></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>