JBoss 4 to JBoss 5 (JNDI question)
new_open_close May 11, 2010 10:02 AMI've searched, but haven't seen anyone bring up this issue... so I'm assuming we have a configuration problem. 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:
java: Namespace
+- securityManagement (class: org.jboss.security.integration.JNDIBasedSecurityManagement)
+- comp (class: javax.namingMain.Context)
+- DeploymentManager (class: org.jboss.aop.generatedproxies.AOPProxy$4)
+- policyRegistration (class: org.jboss.security.plugins.JBossPolicyRegistration)
+- TransactionPropagationContextImporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
+- app (class: org.jnp.interfaces.NamingContext)
| +- Manager (class: javax.inject.manager.Manager)
+- Mail (class: javax.mail.Session)
+- TransactionPropagationContextExporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
+- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
+- jaas (class: javax.naming.Context)
| +- profileservice (class: org.jboss.security.plugins.SecurityDomainContext)
+- TransactionSynchronizationRegistry (class: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple)
+- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
+- XAOracleDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
+- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
+- TransactionManager (class: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate)
+- timedCacheFactory (class: javax.naming.Context)
Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy cannot be cast to javax.naming.NamingEnumeration
+- ManagementView (class: org.jboss.aop.generatedproxies.AOPProxy$3)
but in the code all we see is:
Using bound name < java: > found class < javax.namingMain.Context > with object name < comp >
Using bound name < java: > found class < org.jnp.interfaces.NamingContext > with object name < app >
Using bound name < java: > found class < javax.inject.manager.Manager > with object name < Manager >
Using bound name < java: > found class < org.jboss.security.SubjectSecurityProxyFactory > with object name < SecurityProxyFactory >
Using bound name < java: > found class < javax.naming.Context > with object name < timedCacheFactory >
which appears to be a subset of the available objects. The above log statements were output by:
Context context = new InitialContext();
listContext(context, "java:");
private void listContext(Context ctx, String bName)
{
try
{
NamingEnumeration<Binding> list = ctx.listBindings(bName);
while (list.hasMore())
{
Binding item = (Binding) list.next();
String className = item.getClassName();
String objectName = item.getName();
log.info("Using bound name < " + bName + " > found class < "
+ className + " > with object name < " + objectName + " >");
Object o = item.getObject();
if (o instanceof javax.naming.Context)
{
listContext((Context) o, bName);
}
}
}
catch (NamingException ex)
{
log.warn("JNDI failure: ", ex);
}
}
There were no errors and/or warnings at this point in our code. Any help would be appreciated. Thanks in advance.