[jboss-user] [Beginner's Corner] - JNDI name for xa datasource not found in JBoss-6.0.0.20100429-M3

Jan Mortensen do-not-reply at jboss.com
Thu Aug 23 07:48:47 EDT 2012


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&containerType=14&container=2075]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120823/a109646e/attachment.html 


More information about the jboss-user mailing list