<!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;">
    Cannot map java:/JmsXA to web app resource as java:comp/env/jms/JmsXA
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/chris.wolf">chris.wolf</a> in <i>JNDI and Naming</i> - <a href="https://community.jboss.org/message/809836#809836">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hello,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This is my first post.&#160; I want to use a JMS ConectionFactory via a Resource Adapter, therefore I want the CF boud to "java:JmsXA".&#160; I want to access this from a web application, but it cannot "see" this (returns null upon attempt to lookup).&#160; I don't understand why this is an issue since the web app is in the same VM as the JBoss server.&#160; I wonder if there are other isolation mechanisms to consider for web apps accessing the "java:" namespace?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I know that "JmsXA" can be reconfigured to be in the global namespace, but that will impact other applications on the server that expect it in the "java:" namespace, so that's not an option.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Then I read how these resources can be mapped into a web app's private ENC namespace:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><a class="jive-link-external-small" href="http://docs.jboss.org/jbossas/docs/Server_Configuration_Guide/4/html/ENC_Usage_Conventions-Resource_Manager_Connection_Factory_References.html" target="_blank">http://docs.jboss.org/jbossas/docs/Server_Configuration_Guide/4/html/ENC_Usage_Conventions-Resource_Manager_Connection_Factory_References.html</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>So in my WEB-INF/web.xml, I put:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; &lt;resource-ref&gt;</p><p>&#160;&#160;&#160; &lt;res-ref-name&gt;jms/JmsXA&lt;/res-ref-name&gt;</p><p>&#160;&#160;&#160; &lt;res-type&gt;javax.jms.ConnectionFactory&lt;/res-type&gt;</p><p>&#160;&#160;&#160; &lt;res-auth&gt;Container&lt;/res-auth&gt;</p><p>&#160; &lt;/resource-ref&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>...and in WEB-INF/jboss-web.xml, I put:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</p><p><span>&lt;jboss-web xmlns:xs="</span><a class="jive-link-external-small" href="http://www.jboss.org/j2ee/schema" target="_blank">http://www.jboss.org/j2ee/schema</a><span>" version="5.1"</span></p><p><span>&#160;&#160;&#160;&#160; xs:schemaLocation="</span><a class="jive-link-external-small" href="http://www.jboss.org/j2ee/schema" target="_blank">http://www.jboss.org/j2ee/schema</a></p><p><span>&#160;&#160;&#160;&#160; </span><a class="jive-link-external-small" href="http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd" target="_blank">http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd</a><span>"&gt;</span></p><p>&#160; &lt;resource-ref&gt;</p><p>&#160;&#160;&#160; &lt;res-ref-name&gt;jms/JmsXA&lt;/res-ref-name&gt;</p><p>&#160;&#160;&#160; &lt;jndi-name&gt;java:/JmsXA&lt;/jndi-name&gt;</p><p>&#160; &lt;/resource-ref&gt;</p><p>&lt;/jboss-web&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Then in the web app code I tried to do a lookup for "java:comp/env/jms/JmsXA" but it returned null.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><em><strong>How can web app code access java:JmsXA??</strong></em></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I already searched this forum and FAQs, e.g.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><a class="jive-link-external-small" href="https://community.jboss.org/message/440879#440879#440879" target="_blank">https://community.jboss.org/message/440879#440879</a></p><p><a class="jive-link-external-small" href="https://community.jboss.org/thread/47131?tstart=0" target="_blank">https://community.jboss.org/thread/47131?tstart=0</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>but there's no info on web app code accessing java:JmsXA.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>If I re-package my code as a Spring deployment and deploy using "Snowdrop", then the <em>same </em>code works and can access "java:JmsXA", but I'd rather</p><p>depoy as a web app.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><a class="jive-link-external-small" href="http://www.jboss.org/snowdrop" target="_blank">http://www.jboss.org/snowdrop</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Oh and it's JBoss-6.1.0&#160; due to legacy apps, we have to stick with this old realease for now.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Chris</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/809836#809836">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JNDI and Naming at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


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

</div>

</body>
</html>