aspose file tools*
The moose likes Websphere and the fly likes JNDI Lookup problem in WSAD 4.1.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "JNDI Lookup problem in WSAD 4.1.1" Watch "JNDI Lookup problem in WSAD 4.1.1" New topic
Author

JNDI Lookup problem in WSAD 4.1.1

Jason Hunt
Ranch Hand

Joined: Sep 09, 2002
Posts: 51
Hi:
I try to do the jndi lookup for one stateless ejb from stateful bean, but I get the following error message:
RemoteException occurred in server thread; nested exception is: com.ibm.ejs.container.UncheckedException: ; nested exception is: javax.ejb.EJBException: Name comp/env/ejb not found in context "java:".

The following is my ejb-jar.xml file:
<?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd">
<ejb-jar id="ejb-jar_ID">
<enterprise-beans>
<session id="Hello">
<ejb-name>Hello</ejb-name>
<home>stateless.HelloHome</home>
<remote>stateless.Hello</remote>
<ejb-class>stateless.HelloBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
<session id="Welcome">
<ejb-name>Welcome</ejb-name>
<home>stateful.WelcomeHome</home>
<remote>stateful.Welcome</remote>
<ejb-class>stateful.WelcomeBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
<ejb-ref id="EjbRef_1">
<ejb-ref-name>ejb/Hello</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>stateless.HelloHome</home>
<remote>stateless.Hello</remote>
<ejb-link>Hello</ejb-link>
</ejb-ref>
</session>
</enterprise-beans>
</ejb-jar>

And in my code I use the following code to do the lookup:
Object o = jndiCtx.lookup("java:comp/env/ejb/Hello");

But I got the error:
javax.ejb.EJBException: Name comp/env/ejb not found in context "java:".

any help is really appreciated. Thanks in advance.



SCJP, SCWCD, SCBCD, SCDJWS, OCA9i,<br />IBM Certified WAS5.0 Admin<br />IBM Certified Solution Developer - WebSphere Studio 5.0<br />IBM Certified Solution Developer - XML and related Technologies
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JNDI Lookup problem in WSAD 4.1.1
 
Similar Threads
JNDI Name not found error in SUN ONE SERVER
EJB deployment and calling local interface
Problem looking up local interface of Session Beans - WSAD 5.1, WAS 5.0 Test Env
Lookup strings question
Ejb Problem