geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lin Sun" <linsun....@gmail.com>
Subject RE: ejb NameNotFound exception?
Date Wed, 08 Mar 2006 15:11:37 GMT
Hi, 

 

If the web application and ejb are bundled together in an ear file as you
mentioned earlier in your post, you may want to use ejb-local-ref tag
instead.  

>From Aaron's book:

 

The ejb-local-ref element is used to connect to an EJB through its local
home and local interfaces.

The EJB is usually defined in the same EAR as the web application, though it
may also be in an

EJB JAR or application EAR which is defined as a parent of the current
application.

 

If so, the web.xml in magicgball sample can be served as an example:

 

            <ejb-local-ref>

                        <ejb-ref-name>mGball</ejb-ref-name>

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

 
<local-home>org.acme.MagicGBallLocalHome</local-home>

                        <local>org.acme.MagicGBallLocal</local>

 
<ejb-link>magicGball-ejb-1.0.jar#MagicGBall</ejb-link>

            </ejb-local-ref>

 

 

Thanks, 

 

Lin

-----Original Message-----
From: Vamsavardhana Reddy [mailto:c1vamsi1c@gmail.com] 
Sent: Wednesday, March 08, 2006 6:00 AM
To: user@geronimo.apache.org
Subject: Re: ejb NameNotFound exception?

 

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.

Let me know if this works.

Regards,
Vamsi

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>
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>
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