geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Mulder" <ammul...@alumni.princeton.edu>
Subject Re: ejb NameNotFound exception?
Date Wed, 08 Mar 2006 15:23:58 GMT
On 3/8/06, Vamsavardhana Reddy <c1vamsi1c@gmail.com> wrote:
> Hi Kristian,
>
>  I think you need a ejb-ref tag in web.xml .
>
>      <ejb-ref>
>      <ejb-ref-name>Simple</ejb-ref-name>  <!-- This should
> match the "jndi-name" from openejb-jar.xml -->
>      <ejb-ref-type>Session</ejb-ref-type>
>
>      <home>ejbs.SimpleHome</home>
>      <remote>ejbs.Simple</remote>
>      </ejb-ref>
>
>  and ic.lookup("java:comp/env/Simple") should be able to find the EJB.

There's a little more required.  If the WAR and EJB JAR are in an EAR,
the ejb-ref shows above should include an ejb-link containing the
ejb-name of the EJB to refer to.  If the WAR and EJB JAR are deployed
separately, then the geronimo-web.xml would need to include an ejb-ref
element corresponding to the ejb-ref tag in web.xml.  There are two
options to point to the EJB: ejb-link and target-name.  I think you
might need to use target-name if the EJB isn't in the same EAR, which
is a little unfortunate, but I could be wrong.  There are more details
and an example here:

http://chariotsolutions.com/geronimo/web-plan.html#web-plan-refs

Thanks,
    Aaron

> On 3/8/06, Kristian Rink <krink@pm-planc.de> wrote:
> > Hi Vamsavardhana,
> >
> > and thanks for your mail. :)
> >
> > Vamsavardhana Reddy schrieb:
> > > Kristian,
> > >
> > > I should have been more specific.  Please send the deployment descriptor
> > > and plan for the web application.
> >
> > Hmmm. :) Okay, here we go:
> >
> > geronimo-web.xml:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <web-app
> xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0 "
> > xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.0"
> > xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1
> "
> >
> xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.0"
> > configId="SimpleWeb/SimpleWeb">
> >   <context-root>/SimpleWeb</context-root>
> >
> <context-priority-classloader>false</context-priority-classloader>
> > </web-app>
> >
> >
> >
> > web.xml:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <web-app id="WebApp_ID" version=" 2.4"
> > xmlns="http://java.sun.com/xml/ns/j2ee"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
> > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd ">
> >         <display-name>
> >         SimpleWeb</display-name>
> >         <welcome-file-list>
> >                 <welcome-file>index.html</welcome-file>
> >                 <welcome-file> index.htm</welcome-file>
> >                 <welcome-file>index.jsp</welcome-file>
> >                 <welcome-file>default.html</welcome-file>
> >                 <welcome-file>default.htm </welcome-file>
> >                 <welcome-file>default.jsp</welcome-file>
> >         </welcome-file-list>
> > </web-app>
> >
> >
> >
> > The web application, the Bean and the BeanClient module are packaged
> > into an EAR with
> >
> >
> > geronimo-application.xml:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <application
> > xmlns="
> http://geronimo.apache.org/xml/ns/j2ee/application-1.0"
> >
> xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1"
> > xmlns:sys="
> http://geronimo.apache.org/xml/ns/deployment-1.0"
> > application-name="SimpleBeanEAR"
> configId="SimpleBeanEAR/SimpleBeanEAR"/>
> >
> >
> >
> > and application.xml:
> >
> > <?xml version=" 1.0" encoding="UTF-8"?>
> > <application id="Application_ID" version="1.4"
> > xmlns="http://java.sun.com/xml/ns/j2ee"
> > xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
> > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> > http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
> >         <display-name>
> >         SimpleBeanEAR</display-name>
> >         <module>
> >                 <ejb>SimpleBean.jar</ejb>
> >         </module>
> >
> >         <module>
> >                 <web>
> >
> <web-uri>SimpleBeanWeb.war</web-uri>
> >
> <context-root>SimpleBeanWeb</context-root>
> >                 </web>
> >         </module>
> > </application>
> >
> >
> > respectively. I have to admit I haven't modified any of these by now,
> > since I'm just slowly starting to understand the meaning of the vast
> > bunch of deployment-related xml files, so I relied upon xdoclect to
> > create things the way they should be... *blush*
> >
> >
> > TIA and bye,
> > Kris
> >
> > --
> > Kristian Rink   -- Programmierung/Systembetreuung
> > planConnect GmbH * Strehlener Str. 12 - 14 * 01069 Dresden
> > 0176 24472771 * krink@pm-planc.de
> >
>
>

Mime
View raw message