• Post Reply Bookmark Topic Watch Topic
  • New Topic

locate stateless session bean (ejb 3.0) in webservice endpoint  RSS feed

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 ?

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!