Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Get EJB Home from another EJB method?

A Harry
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've drawn a complete blank with this & am begining to think I'm the only one in the entire world that's tried it!

From one EJB I want to get the home object for another EJB - but I HAVE to use something like -

home = (EJBLocalHome) context.lookup("ejb/EJB1");


home = (EJBLocalHome) context.lookup("java:comp/env/ejb/EJB1");

throws a NamingException

From another class such as a Struts Action method the latter works fine!

Is this what's supposed to happen, is it my fault or what?

As far as I can see all <ejb-local-ref> are setup fine!

Please someone put me out of my misery! - can this be done?


  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic