Win a copy of Pipeline as Code this week in the Cloud/Virtualization 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 ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

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

 
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
I claim this furniture in the name of The Ottoman Empire! You can keep this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic