File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Stateless EBJ using JNDI to get DataSource with JBOSS 4.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Stateless EBJ using JNDI to get DataSource with JBOSS 4.2" Watch "Stateless EBJ using JNDI to get DataSource with JBOSS 4.2" New topic
Author

Stateless EBJ using JNDI to get DataSource with JBOSS 4.2

Tim Gilbert
Greenhorn

Joined: Dec 08, 2009
Posts: 1
Please consider that I have a stateless EBJ that accesses a mysql database via:



Then I have a Servlet in a different project (Dynamic Web)

WEB-INF/jboss-web.xml


then in my WEB-INF/web.xml


and finally I have a mysql-ds.xml in my jboss/deploy directory.

This works, however, it makes no sense to me. I would much rather have WEB-INF stuff defined at the EAR level as I can't think of a reason why I'd want to define something that the ejbModule needs in another possibly unrelated project. I am a java newbie, so I don't know how to make those connections outside of the WEB-INF, which I discovered by googleing.

Can anyone point me in the right direction?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10288
    
168

The WEB-INF, web.xml and jboss-web.xml are irrelevant for an EJB module. Remove those files and i am sure it will still work


[My Blog] [JavaRanch Journal]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Stateless EBJ using JNDI to get DataSource with JBOSS 4.2