• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Error looking up EJB

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

How can I access a local EJB from a servlet by its JNDI name when both application are not in the same EAR?

Both application are running in the same server (WebSphere 6.1). But when I invoke the context.lookup() method passing the JNDI name as parameter, I got a NamingExecption.

This is my code:

StartupMonitorServlet


web.xml




Error message:




There's no EJB reference binding in the ibm-web-bnd.xmi.

Thanks!
[ December 12, 2007: Message edited by: Regis Santos ]
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
You just have to add one entry in your ibm-web-bnd.xmi...
Add id for the ejb reference in the web.xml

Add corresponding entry in ibm-web-bnd.xmi for providing the jndi name...



[ December 17, 2007: Message edited by: Sachin Vrma ]
[ December 17, 2007: Message edited by: Sachin Vrma ]
 
Regis Santos
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Sachin,

I did as you told me. But I got the following exception when the servlet tried to find the local EJB via JNDI.



I tried to change the JNDI name for
cell/nodes/E69Node01/servers/server1/ejb/StartupMonitorBean,
but it wasn't work, too.

These are my deployment descriptors:

ejb-jar.xml




ibm-ejb-jar-bnd.xmi



web.xml



ibm-web-bnd.xmi



FYI: the EJB module and the WAR are in the same EAR.

Thanks,
 
I think I'll just lie down here for a second. And ponder this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic