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 javax.naming.NameNotFoundException: Name comp/env/ejb not found in context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "javax.naming.NameNotFoundException: Name comp/env/ejb not found in context "java:"" Watch "javax.naming.NameNotFoundException: Name comp/env/ejb not found in context "java:"" New topic
Author

javax.naming.NameNotFoundException: Name comp/env/ejb not found in context "java:"

Nicola Garofalo
Ranch Hand

Joined: Apr 10, 2010
Posts: 308
Hi everybody,
i get the following error at runtime while trying to lookup an EJB reosurce, my idea are really far to be clear on this topic.



I am working with RAD 7 (webshpere 7 application server) and EJB 3.0 technology, and i am using annotations.

I don't know if i should set the jndi name for the EJB somewhere else than in the amministrative console while deploying the EAR.

I should bind the ejb name ejb/EJBInsAvviso to "java:comp/env/ejb/EJBInsAvviso" but where?

the lookup code on my web application is




The EJBInsAvvisoLocal interface is:



The EJBInsAvviso implementation of EJBInsAvvisoLocal interface is like




The ejb-jar.xml looks like this



The web.xml file doesn't show any reference to the EJB, nothing like ejb/InsAvviso.


What should i do?
Thanks for the help.
Bye,
Nicola


Bye,
Nicola
Matt Couto
Ranch Hand

Joined: Jul 10, 2009
Posts: 38
Do you really need the ejb-jar.xml as you're using annotations!?
As far as I know there's no need to use the ejb-jar.xml since you're using annotations.
Sorry if I'm wrong.
Nicola Garofalo
Ranch Hand

Joined: Apr 10, 2010
Posts: 308
Matt Couto wrote:Do you really need the ejb-jar.xml as you're using annotations!?
As far as I know there's no need to use the ejb-jar.xml since you're using annotations.
Sorry if I'm wrong.


I agree Matt, i don't need the ejb-jar.xml the problem was that i did not set the entry in the web.xml file

The problem is solved.
Thanks

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javax.naming.NameNotFoundException: Name comp/env/ejb not found in context "java:"
 
Similar Threads
need help on log4j.properties
Need help on Glassfish and EJB lookup
getting error when deploying web app in weblogic 10.0
problem in acessing session bean using jndi
Problems with EJB3.0... (continued)