You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by "Mason, Ross" <ro...@vignette.com> on 2005/04/13 17:32:49 UTC

Writing openejb-jar.xml correctly.

Hi,
 
I'm trying to deploy a simple ejb app with one SessionBean and one MDB.  The problem is I don't know how to write the openejb-jar.xml file.  I've looked at a few in the openejb source but I'm struggling to see how things fit together.  So far I ahve the following -
 
<openejb-jar
    xmlns="http://www.openejb.org/xml/ns/openejb-jar"
    configId="org/mule/samples/ejb"
    parentId="org/apache/geronimo/Server">
    <enterprise-beans>
        <session>
            <ejb-name>SenderEJB</ejb-name>
            <jndi-name>local/SenderEJB</jndi-name>
        </session>
        <message-driven>
            <ejb-name>TcpReceiverMDB</ejb-name>
            <resource-adapter>
                <resource-link>org/mule/ra/Server</resource-link>
            </resource-adapter>
        </message-driven>
    </enterprise-beans>
</openejb-jar>
 
1. I'm not entirely sure I have everything in there.
2. for the session bean, I don't know what I should set the jndi-name to?
3. should the resource-link on the MDB refer to the RAR config name or some other name?
 
Cheers,
 
Ross
 

Re: Writing openejb-jar.xml correctly.

Posted by David Jencks <dj...@gluecode.com>.
On Apr 13, 2005, at 8:32 AM, Mason, Ross wrote:

> Hi,
>  
> I'm trying to deploy a simple ejb app with one SessionBean and one 
> MDB.  The problem is I don't know how to write the openejb-jar.xml 
> file.  I've looked at a few in the openejb source but I'm struggling 
> to see how things fit together.  So far I ahve the following -
>  
> <openejb-jar
>     xmlns="http://www.openejb.org/xml/ns/openejb-jar"
>     configId="org/mule/samples/ejb"
>     parentId="org/apache/geronimo/Server">
>     <enterprise-beans>
>         <session>
>             <ejb-name>SenderEJB</ejb-name>
>             <jndi-name>local/SenderEJB</jndi-name>
>         </session>
>         <message-driven>
>             <ejb-name>TcpReceiverMDB</ejb-name>
>             <resource-adapter>
>                 <resource-link>org/mule/ra/Server</resource-link>
>             </resource-adapter>
>         </message-driven>
>     </enterprise-beans>
> </openejb-jar>
>  
> 1. I'm not entirely sure I have everything in there.
> 2. for the session bean, I don't know what I should set the jndi-name 
> to?
it is only used for access by non-j2ee clients including corba.  You 
can include as many as you want with whatever names you want.  See the 
openejb itests for examples.  If you only use j2ee clients (such as an 
app-client) you can leave the session out of the openejb plan 
altogether.
> 3. should the resource-link on the MDB refer to the RAR config name or 
> some other name?
resource-link will only work if the resource adapter is deployed in the 
same ear or as a standalone module and if it is sufficient to resolve 
uniquely.  It should be the resourceadapter-name from the ra plan:
             <resourceadapter-name>ActiveMQ RA</resourceadapter-name>

if the ejb-jar.xml includes all the correct activation spec info this 
should be enough configuration.

hope this helps
david jencks


>  
> Cheers,
>  
> Ross
>