Jan Mortensen [
https://community.jboss.org/people/mortl] created the discussion
"JNDI name for xa datasource not found in JBoss-6.0.0.20100429-M3"
To view the discussion, visit:
https://community.jboss.org/message/755385#755385
--------------------------------------------------------------
Hi,
I want to configure a XA Datasource for a Derby database in a JBoss-6.0.0.20100429-M3
server. I have used the Web Admin Interface to create the atached file
"jdbc-ds.xml". The datasource is successfully bound to
"java:jdbc/__default". Here is the first think which confuses me. I set the JNDI
name to "jdbc/__default" but the console says that the datasource is bound to my
JNDI name prefixed with "java:". Can I lookup the datasource by the name
"java:jdbc/__default" or "jdbc/__default"? What is the reason for the
prefix?
Then I want to access the datasource inside of a bean, deployed on the server, with the
following code:
[code]
private static final String JNDI_NAME_XA = "jdbc/__default";
@Resource(name = JNDI_NAME_XA)
private DataSource _ds_xa;
[/code]
When the server trys to deploy the bean, the console output says "mapped-name is
required for jdbc/__default of deployment PlainDataSourceTestBean" and the bean is
not deployed. I also tryed the JNDI name "java:jdbc/__default" with the same
result, although a few lines above the console output says "Bound ConnectionManager
'jboss.jca:service=DataSourceBinding,name=jdbc/__default' to JNDI name
'java:jdbc/__default'".
Which JNDI name do i really have to use, and do I have do do some more configuration?
Regards,
Jan
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/755385#755385]
Start a new discussion in Beginner's Corner at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]