File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes DataSource JNDI name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "DataSource JNDI name" Watch "DataSource JNDI name" New topic
Author

DataSource JNDI name

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Anyone know how you configure a DataSource so it can be looked up from an EJB in java:comp/env/ rather than directly from java:/ ?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10048
    
163

A resource-ref entry needs to be made in the ejb-jar.xml and the corresponding jboss.xml. Something like this:

ejb-jar.xml:



jboss.xml:



The datasource will then be available to that EJB at java:comp/env/someName/someOtherName.


[My Blog] [JavaRanch Journal]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Ah - of course! Thanks Jaikiran.
 
Don't get me started about those stupid light bulbs.
 
subject: DataSource JNDI name