Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Anchor
top
top
Article donated by: Henry Isidro, Leonard Flournoy, Hernan Cunico
A typical J2EE application may contain Enterprise JavaBeans or EJBs. These beans contain the application's business logic and live business data. Although it is possible to use standard Java objects to contain your business logic and business data, using EJBs addresses many of the issues of using simple Java objects, such as scalability, lifecycle management and state management.

...

This will compile the source files and package the EJB jar file. You can see the results in the <session_home>/target directory. The following list shows the dependency jars needed in building and running the Session Bean sample application.

  • geronimo-spec-ejb-_2.1_spec-rc41.0.jar - the EJB spec; needed for compiling source.
  • openejb-core-2.0-G1M5.jar - needed by Geronimo during runtime.
  • geronimo-spec-j2ee-_1.4_spec-rc41.0.jar - needed by Geronimo during runtime.
  • geronimo-security-1.0-M5.jar - needed by Geronimo during runtime.

...

Code Block
xml
xml
borderStylesolid
titleopenejb-jar.xml
<openejb-jar
    xmlns="http://www.openejb.org/xml/ns/openejb-jar"
    xmlns:naming="http://geronimo.apache.org/xml/ns/naming"
    xmlns:security="http://geronimo.apache.org/xml/ns/security"
    xmlns:sys="http://geronimo.apache.org/xml/ns/deployment"
    configId="geronimo/SessionBeanDemo/1.0/car"
    parentId="orggeronimo/apache/geronimo/Serverj2ee-server/1.0/car">
 <enterprise-beans>
 	
    <entity>
        <ejb-name>CustomerEJB</ejb-name>
        <jndi-name>CustomerHomeRemote</jndi-name>
        <local-jndi-name></local-jndi-name>
        <resource-ref>
            <ref-name>jdbc/ibm-demo</ref-name>
            <resource-link>SystemDatasource</resource-link>
        </resource-ref>
    </entity>
    
    <session>
        <ejb-name>LoanManagerEJB</ejb-name>
        <jndi-name>LoanManagerHomeRemote</jndi-name>
        <ejb-ref>
            <ref-name>ejb/CustomerHomeRemote</ref-name>
            <ejb-link>CustomerEJB</ejb-link>
        </ejb-ref>        
   </session>
 	
 	<session>
        <ejb-name>StatefulLoanManagerEJB</ejb-name>
        <jndi-name>StatefulLoanManagerHomeRemote</jndi-name>
        <ejb-ref>
            <ref-name>ejb/CustomerHomeRemote</ref-name>
            <ejb-link>CustomerEJB</ejb-link>
        </ejb-ref>        
   </session>
   
 </enterprise-beans>
    
</openejb-jar>

As with all Geronimo deployment plans, this configuration requires a parent configuration. In this case, it is orggeronimo/apache/geronimo/Serverj2ee-server/1.0/car, then follows the definition of the EJBs.

...