• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

NameNotFoundException: Name comp/env/ejb in related servlet project.

Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I've got an ejb project containing some session beans, which I try to access from a project which is used by web project.
Web Project -> Utility Project -> EJB Project.
Trying to access the sessionbean in the EJB project directly from the servlet (code) goes well so the references in the web.xml file are correctly set I assume. However trying to access the session bean from the utility project is not giving me the error mentioned in the subject field.
I suppose the ejbreferences are not propageted through the related projects but I'm not sure how to achieve this in WSAD.

Code below does succesful execute in the servlet,
but not in utility project.
try {
InitialContext ic = new InitialContext();
Object home = ic.lookup("java:comp/env/ejb/SessionDataLoaderHome");
PortableRemoteObject.narrow(home, SessionDataLoaderHome.class);

and the references in the web.xml file.
<ejb-ref id="EjbRef_1122301931984">

Any help would be greatly appreciated!
Whose rules are you playing by? This tiny ad doesn't respect those rules:
a bit of art, as a gift, that will fit in a stocking
    Bookmark Topic Watch Topic
  • New Topic