Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

JNDI Lookup problem in WSAD 4.1.1

Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: ; 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" "">;
<ejb-jar id="ejb-jar_ID">
<session id="Hello">
<session id="Welcome">
<ejb-ref id="EjbRef_1">

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.

Your buns are mine! But you can have this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!