Configured datasource not found via JNDI
mign Sep 22, 2011 9:06 AMThe config looks like this:
<datasource jndi-name="jdbc/asepData" pool-name="asepData_Pool" enabled="true" jta="true" use-java-context="false" use-ccm="true">
<connection-url>...
</datasource>
Whatever I try to access does not find anything:
Context initialContext = new InitialContext();
ds = (DataSource) initialContext.lookup("jdbc/asepData");
or initialContext.lookup("java:env/comp/jdbc/asepData");
or initialContext.lookup("java:jdbc/asepData");
It just says:
javax.naming.NameNotFoundException: Name 'jdbc' not found in context ''
Executing /subsystem=naming:jndi-view in jboss-admin.sh does return
[standalone@localhost:9980 /] /subsystem=naming:jndi-view
{
"outcome" => "success",
"result" => {
"java: contexts" => {
"java:" => undefined,
"java:jboss" => {
"jaas" => {
"class-name" => "org.jboss.as.naming.context.ModularReference",
"children" => {"other" => {
"class-name" => "org.jboss.as.security.plugins.SecurityDomainContext",
"value" => "org.jboss.security.authentication.JBossCachedAuthenticationManager@1317bfb"
}}
},
"TransactionManager" => {
"class-name" => "org.jboss.as.naming.context.ModularReference",
"value" => "com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate@b427c1"
},
"datasources" => {
"class-name" => "javax.naming.Context",
"children" => {"ExampleDS" => {
"class-name" => "org.jboss.as.naming.context.ModularReference",
"value" => "org.jboss.jca.adapters.jdbc.WrapperDataSource@9c8834"
}}
},
"UserTransaction" => {
"class-name" => "org.jboss.as.naming.context.ModularReference",
"value" => "Transaction: unknown"
},
"TransactionSynchronizationRegistry" => {
"class-name" => "org.jboss.as.naming.context.ModularReference",
"value" => "com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple@398896"
}
},
"java:global" => {"asepdemo-ear-1.1.0-SNAPSHOT" => {
"class-name" => "javax.naming.Context",
"children" => undefined
}}
},
"applications" => undefined
}
}
So my binding does not seem to be there in the context...