Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Nicola Garofalo
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Matt Couto
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 308
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic