<!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="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">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 4 to JBoss 5 (JNDI question)
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/new_open_close">New Close</a> in <i>JNDI and Naming</i> - <a href="http://community.jboss.org/message/542318#542318">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>I've searched, but haven't seen anyone bring up this issue... so I'm assuming we have a configuration problem.&#160; We're trying to test our code with JBoss 5 (jboss-5.1.0.GA), and have run into trouble when looking up the datasource (DefaultDS and XAOracleDS) in JNDI. It appears in the JMX console:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre><h1>java: Namespace</h1><br/><pre>&#160; +- securityManagement (class: org.jboss.security.integration.JNDIBasedSecurityManagement)<br/>&#160; +- comp (class: javax.namingMain.Context)<br/>&#160; +- DeploymentManager (class: org.jboss.aop.generatedproxies.AOPProxy$4)<br/>&#160; +- policyRegistration (class: org.jboss.security.plugins.JBossPolicyRegistration)<br/>&#160; +- TransactionPropagationContextImporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)<br/>&#160; +- app (class: org.jnp.interfaces.NamingContext)<br/>&#160; |&#160;&#160; +- Manager (class: javax.inject.manager.Manager)<br/>&#160; +- Mail (class: javax.mail.Session)<br/>&#160; +- TransactionPropagationContextExporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)<br/>&#160; +- <strong>DefaultDS</strong> (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)<br/>&#160; +- jaas (class: javax.naming.Context)<br/>&#160; |&#160;&#160; +- profileservice (class: org.jboss.security.plugins.SecurityDomainContext)<br/>&#160; +- TransactionSynchronizationRegistry (class: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple)<br/>&#160; +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)<br/>&#160; +- <strong>XAOracleDS</strong> (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)<br/>&#160; +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)<br/>&#160; +- TransactionManager (class: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate)<br/>&#160; +- timedCacheFactory (class: javax.naming.Context)<br/>Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy cannot be cast to javax.naming.NamingEnumeration<br/>&#160; +- ManagementView (class: org.jboss.aop.generatedproxies.AOPProxy$3)</pre>
</pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>but in the code all we see is:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Using bound name &lt; java: &gt; found class &lt; javax.namingMain.Context &gt; with object name &lt; comp &gt;</p><p>Using bound name &lt; java: &gt; found class &lt; org.jnp.interfaces.NamingContext &gt; with object name &lt; app &gt;</p><p>Using bound name &lt; java: &gt; found class &lt; javax.inject.manager.Manager &gt; with object name &lt; Manager &gt;</p><p>Using bound name &lt; java: &gt; found class &lt; org.jboss.security.SubjectSecurityProxyFactory &gt; with object name &lt; SecurityProxyFactory &gt;</p><p>Using bound name &lt; java: &gt; found class &lt; javax.naming.Context &gt; with object name &lt; timedCacheFactory &gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>which appears to be a subset of the available objects.&#160; The above log statements were output by:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160; Context context =&#160; new InitialContext();</p><p>&#160;&#160; listContext(context, "java:");</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; private void listContext(Context ctx, String bName)</p><p>&#160;&#160; {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; try</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; NamingEnumeration&lt;Binding&gt; list = ctx.listBindings(bName);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; while (list.hasMore())</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Binding item = (Binding) list.next();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; String className = item.getClassName();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; String objectName = item.getName();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; log.info("Using bound name &lt; " + bName + " &gt; found class &lt; "</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; + className + " &gt; with object name &lt; " + objectName + " &gt;");</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Object o = item.getObject();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (o instanceof javax.naming.Context)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; listContext((Context) o, bName);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; catch (NamingException ex)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; log.warn("JNDI failure: ", ex);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>There were no errors and/or warnings at this point in our code.&#160; Any help would be appreciated.&#160; Thanks in advance.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/542318#542318">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JNDI and Naming at <a href="http://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>