• 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");

as

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?

thanks

Harry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!