openejb-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Dellisanti <nicola.dellisa...@gmail.com>
Subject Re: calling ejb from backing bean
Date Mon, 14 Feb 2011 10:04:28 GMT
Hi Jean-Louis,

yes, I have the ejb jar file deployed as a standaalone module under tomcat
webapps directory and my jsf backing bean is under a webapps, also deployed
under tomcat webapps.

In my backing bean I try to retrieve the ebj by:

RichTestEJB ejb = (RichTestEJB) *new* InitialContext().lookup(
"java:comp/env/ejb/richtestejb");
in my web.xml I wrote:


<ejb-local-ref>

<ejb-ref-name>*ejb*/*richtestejb*</ejb-ref-name>

<ejb-ref-type>Session</ejb-ref-type>

<local-home>it.het.ritchtest.ejb.RichTestEJB</local-home>

<local>it.het.ritchtest.ejb.RichTestEJB</local>

<ejb-link>RichTestEJBBeanLocal</ejb-link>

</ejb-local-ref>
in <local-home> and in <local> there is the ejb interface.
in the <ejb-link> there is the ejb name I find in the openjeb page
http://localhost:8080/openejb/viewjndi.jsp I don't know if it's correct in
the web.xml

At runtime I got the exception: "java.lang.RuntimeException:
javax.naming.NameNotFoundException: Name RichTestEJBBeanLocal is not bound
in this Context"

Is the matter in my web.xml?

N.

2011/2/14 Jean-Louis MONTEIRO <jeanouii@gmail.com>

>
> Hi,
>
> what's the problem exactly?
> You have a ejb jar file deployed as a standalone module under tomcat
> webapps
> directory, right?
> Your JSF backing bean is under a webapp, also deployed under tomcat
> webapps,
> right?
>
> If you just create a context, you won't be able to get the EJB reference.
> You will need to get it imported in your naming context (web.xml).
>
> Hope it helps.
> Jean-Louis
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/calling-ejb-from-backing-bean-tp3301535p3304613.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message