Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

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

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

in my bean interface i have :
@Local
public interface InsurabilityFacade {...
In the implementation :
@Stateless(name="InsurabilityFacade")
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

<ejb-local-ref>
<ejb-ref-name>ejb/InsurabilityFacade</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>be.cm.apps.insurability.business.InsurabilityFacade</local>
</ejb-local-ref>

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

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