mign [
http://community.jboss.org/people/mign] created the discussion
"Configured datasource not found via JNDI"
To view the discussion, visit:
http://community.jboss.org/message/628031#628031
--------------------------------------------------------------
The 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...
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/628031#628031]
Start a new discussion in JBoss AS7 Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]