<!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.&#160; I'm having a horrible experience and still do not have anything working.&#160; Can you see what I'm doing wrong?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="text-decoration: underline;">My CLI Command</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>At a command prompt I'm executing the following:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>jboss-cli.bat --connect controller=myserver:myport --file=mycmds.cli</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The "mycmds.cli" file contains the following:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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;">&#160;</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;">&#160;</p><p>&#160; &lt;xa-datasource&gt;</p><p>&#160;&#160;&#160; &lt;jndi-name&gt;MyDB&lt;/jndi-name&gt;</p><p>&#160;&#160;&#160; &lt;track-connection-by-tx&gt;true&lt;/track-connection-by-tx&gt;</p><p>&#160;&#160;&#160; &lt;isSameRM-override-value&gt;false&lt;/isSameRM-override-value&gt;</p><p>&#160;&#160;&#160; &lt;xa-datasource-class&gt;oracle.jdbc.xa.client.OracleXADataSource&lt;/xa-datasource-class&gt;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&lt;!-- The line below is used only for mysql installations.&#160; --&gt; </p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&lt;!--new-connection-sql&gt;set autocommit=1&lt;/new-connection-sql--&gt;</p><p>&#160;&#160;&#160; &lt;xa-datasource-property name="URL"&gt;jdbc:oracle:thin:@localhost:1521:XE&lt;/xa-datasource-property&gt;</p><p>&#160;&#160;&#160; &lt;xa-datasource-property name="User"&gt;myUser&lt;/xa-datasource-property&gt;</p><p>&#160;&#160;&#160; &lt;xa-datasource-property name="Password"&gt;myPassword&lt;/xa-datasource-property&gt;</p><p>&#160;&#160;&#160; &lt;no-tx-separate-pools /&gt;</p><p>&#160;&#160;&#160; &lt;check-valid-connection-sql&gt;select count(*) from MYTABLE&lt;/check-valid-connection-sql&gt;</p><p>&#160; &lt;/xa-datasource&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p> <span style="text-decoration: underline;">Oracle driver (ojdbc14.jar)</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I first deployed this as a regular JAR by copying it to the standalone/deployments folder and added a .dodeploy file.&#160; 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;">&#160;</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.&#160; It redeployed successfully but I still received the CLI error message.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Finally, I undeployed the Oracle driver as a regular JAR and added it as a module.&#160; I created a modules/oracle/jdbc/main folder, copied the original JAR into this folder and added a module.xml file.&#160; The module.xml file contains</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;module xmlns="urn:jboss:module:1.1" name="oracle.jdbc"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;resources&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;resource-root path="ojdbc14.jar"/&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/resources&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dependencies&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module name="javax.api"/&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/dependencies&gt;</p><p>&lt;/module&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I restarted JBoss, retried my CLI command and received the same error message.&#160; I also tried changing the driver name from "oracle.jdbc.driver.OracleDriver" to "oracle.jdbc" and "ojdbc14.jar".&#160; In both cases, I still receive the CLI error message "XXX is not installed".</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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.&#160; 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;">&#160;</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>