File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Name comp/env/jdbc not found in context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Name comp/env/jdbc not found in context "java:"." Watch "Name comp/env/jdbc not found in context "java:"." New topic
Author

Name comp/env/jdbc not found in context "java:".

G Lambert
Greenhorn

Joined: May 14, 2009
Posts: 11
Greetings. I know this issue is somewhat common, however nothing I've read has been able to assist me.

I'm currently migrating a Jboss application to use WAS 8 EJB 3.1. It is an older application.

I get the error "java.rmi.RemoteException: Name comp/env/jdbc not found in context "java:"." despite the datasources being set up in both the web.xml and the ibm-web.bnd.xmi files.

WEB.XML:


ibm-web.bnd.xmi (which I'm sure you know hides the reference back to "jdbc/MyDB"):


The WAS admin console has the datasource correctly setup with a green test connection and is definitely called "jdbc/ActualDS"

I execute the indirect JNDI lookup (it MUST be indirect, I cannot use "jdbc/MyDB" in the lookup string to get around the issue) ...


...but receive the error:

java.rmi.RemoteException: Name comp/env/jdbc not found in context "java:".

When I research the issue, the IBM docs tell me to do exactly what I've already done (e.g., create references in both the web.xml and binding files).

What am I missing? And yes, I know I can use annotations, it's a major refactor I might do, but it's off-topic at the moment. This was of course all working in Jboss as-is, but it used the jboss-web.xml to create the references.

Appreciate any help...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Name comp/env/jdbc not found in context "java:".