<!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;">
    JNDI name for xa datasource not found in JBoss-6.0.0.20100429-M3
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/mortl">Jan Mortensen</a> in <i>Beginner's Corner</i> - <a href="https://community.jboss.org/message/755385#755385">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 want to configure a XA Datasource for a Derby database in a JBoss-6.0.0.20100429-M3 server. I have used the Web Admin Interface to create the atached file "jdbc-ds.xml". The datasource is successfully bound to "java:jdbc/__default". Here is the first think which confuses me. I set the JNDI name to "jdbc/__default" but the console says that the datasource is bound to my JNDI name prefixed with "java:". Can I lookup the datasource by the name "java:jdbc/__default" or "jdbc/__default"? What is the reason for the prefix?</p><p>Then I want to access the datasource inside of a bean, deployed on the server, with the following code:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>[code]</p><p>private static final String JNDI_NAME_XA = "jdbc/__default";</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>@Resource(name = JNDI_NAME_XA)</p><p>private DataSource _ds_xa;</p><p>[/code]</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>When the server trys to deploy the bean, the console output says "mapped-name is required for jdbc/__default of deployment PlainDataSourceTestBean" and the bean is not deployed. I also tryed the JNDI name "java:jdbc/__default" with the same result, although a few lines above the console output says "Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/__default' to JNDI name 'java:jdbc/__default'".</p><p>Which JNDI name do i really have to use, and do I have do do some more configuration?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Regards,</p><p>Jan</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/755385#755385">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Beginner's Corner at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


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

</div>

</body>
</html>