<!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;">
Re: JBoss 7 multiple data source declarations for multiple applications
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/kdolan1">Kelly Dolan</a> in <i>Datasource Configuration</i> - <a href="https://community.jboss.org/message/736575#736575">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Ok, I hear you so I spent most of today removing my -ds.xml files and trying to use the CLI to create my data source.  I'm having a horrible experience and still do not have anything working.  Can you see what I'm doing wrong?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="text-decoration: underline;">My CLI Command</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>At a command prompt I'm executing the following:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>jboss-cli.bat --connect controller=myserver:myport --file=mycmds.cli</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The "mycmds.cli" file contains the following:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>xa-data-source add --name=MyDB --jndi-name=java:jboss/datasources/MyDB --user-name=myName --password=myPassword --driver-name=oracle.jdbc.driver.OracleDriver --xa-datasource-class=oracle.jdbc.xa.client.OracleXADataSource --same-rm-override=false --no-tx-separate-pool=true --check-valid-connection-sql="select count(*) from MYTABLE"</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>My original -ds.xml file (from JBoss 4.x) I'm trying to convert to JBoss 7.x contained the following:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  <xa-datasource></p><p>    <jndi-name>MyDB</jndi-name></p><p>    <track-connection-by-tx>true</track-connection-by-tx></p><p>    <isSameRM-override-value>false</isSameRM-override-value></p><p>    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class></p><p>          <!-- The line below is used only for mysql installations.  --> </p><p>          <!--new-connection-sql>set autocommit=1</new-connection-sql--></p><p>    <xa-datasource-property name="URL">jdbc:oracle:thin:@localhost:1521:XE</xa-datasource-property></p><p>    <xa-datasource-property name="User">myUser</xa-datasource-property></p><p>    <xa-datasource-property name="Password">myPassword</xa-datasource-property></p><p>    <no-tx-separate-pools /></p><p>    <check-valid-connection-sql>select count(*) from MYTABLE</check-valid-connection-sql></p><p>  </xa-datasource></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p> <span style="text-decoration: underline;">Oracle driver (ojdbc14.jar)</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I first deployed this as a regular JAR by copying it to the standalone/deployments folder and added a .dodeploy file.  It deployed successfully but when I ran my CLI command above, it said "oracle.jdbc.driver.OracleDriver" not installed.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I then tried adding to the jar the java.sql.Driver file (as described in the JBoss documentation) to the JAR thinking this might be the problem.  It redeployed successfully but I still received the CLI error message.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Finally, I undeployed the Oracle driver as a regular JAR and added it as a module.  I created a modules/oracle/jdbc/main folder, copied the original JAR into this folder and added a module.xml file.  The module.xml file contains</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><module xmlns="urn:jboss:module:1.1" name="oracle.jdbc"></p><p>        <resources></p><p>                <resource-root path="ojdbc14.jar"/></p><p>        </resources></p><p>        <dependencies></p><p>                <module name="javax.api"/></p><p>        </dependencies></p><p></module></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I restarted JBoss, retried my CLI command and received the same error message.  I also tried changing the driver name from "oracle.jdbc.driver.OracleDriver" to "oracle.jdbc" and "ojdbc14.jar".  In both cases, I still receive the CLI error message "XXX is not installed".</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Ultimately, I'm fine setting up Oracle as a module (vs. deployment) because I must also support MySQL and I found in the JBoss documentation it must be configured as a module because it's "is jdbc compliant" method always returns false or something like that.  Since I must configure that as a module, I might as well be consistent w/ Oracle.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanks!</p><p>Kelly</p><p><span style="text-decoration: underline;"><br/></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/736575#736575">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>