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

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-"

To view the discussion, visit: https://community.jboss.org/message/755385#755385

I want to configure a XA Datasource for a Derby database in a JBoss- 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:

private static final String JNDI_NAME_XA = "jdbc/__default";

@Resource(name = JNDI_NAME_XA)
private DataSource _ds_xa;

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?


Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community

-------------- 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