Forums Register Login

locate stateless session bean (ejb 3.0) in webservice endpoint

+Pie Number of slices to send: Send
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.
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1088 times.
Similar Threads
EJB 3 Local Lookup not working with Weblogic 10.3 and JDK 1.6_05
exception accessing ejb from servlet in OCj4
Webservice and remote ejbs
Problem looking up local interface of Session Beans - WSAD 5.1, WAS 5.0 Test Env
question about ejb-ref
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:11:51.