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

locate stateless session bean (ejb 3.0) in webservice endpoint

chris noe
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm trying to lookup a local session bean, but keep getting NameNotFoundException.

in my bean interface i have :
public interface InsurabilityFacade {...
In the implementation :
public class InsurabilityFacadeImpl implements InsurabilityFacade {...

In my webservice endpoint, where i lookup the bean i have :

@EJB(name="InsurabilityFacade", beanInterface=InsurabilityFacade.class)
(also tried @EJB private InsurabilityFacade insurabilityFacade; )

I thought that would have the stateless session bean in the insurabilityFacade object. But the object remains null.
Shouldn't the @EJB do the lookup ?
Not only, i have to do the lookup explicitly as:
insurabilityFacade = (InsurabilityFacade)context.lookup("ejb/InsurabilityFacade");

I also have to have an entry in my web.xml


Can't i us my session bean in my webservice endpoint without the explicit lookup and the entry in the web.xml ?

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic