• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

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
Hi,

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.
<servlet>
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">
<ejb-ref-name>ejb/SessionDataLoader</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>nl.ing.aiss.sessionfacade.SessionDataLoaderHome</home>
<remote>nl.ing.aiss.sessionfacade.SessionDataLoader</remote>
<ejb-link>SessionDataLoader</ejb-link>
</ejb-ref>

Any help would be greatly appreciated!
regards,
Jeroen.
 
reply
    Bookmark Topic Watch Topic
  • New Topic