Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. In the EJB Project. Under META-INF, Edit openejb-jar.xml and add the following
    Code Block
    titledatasource dependency
    borderStylesolid
    <sys:dependencies>
                <sys:dependency>
                    <sys:groupId>console.dbpool</sys:groupId>
                    <sys:artifactId>jdbc%2Fuserds</sys:artifactId>
                </sys:dependency>        
    </sys:dependencies>
    
    Finally the openejb-jar.xml will look like this To make the datasource visible to EJB we need to add a dependency to the EJB deployment plan that is . The above element can be obtained automatically from Geronimo Database Pool wizard. Select usage against the database pool jdbc/userds
    Code Block
    Info
    titleWhere did the above dependencies come from??
    title
    openejb-jar.xml
    borderStylesolid
    
    <?xml version="1.0" encoding="UTF-8"?>
    <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.2" xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2" xmlns:pkgen="http://www.openejb.org/xml/ns/pkgen-2.0" xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.2" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
      <sys:environment>
        <sys:moduleId>
          <sys:groupId>default</sys:groupId>
          <sys:artifactId>StatelessSessionEJB</sys:artifactId>
          <sys:version>1.0</sys:version>
          <sys:type>car</sys:type>
        </sys:moduleId>
        <sys:dependencies>
                <sys:dependency>
                    <sys:groupId>console.dbpool</sys:groupId>
                    <sys:artifactId>jdbc%2Fuserds</sys:artifactId>
                </sys:dependency>        
    </sys:dependencies>
      </sys:environment>
      <enterprise-beans/>
    </openejb-jar>
    
    Info
    titleWhere did the above dependencies come from??

    To make the datasource visible to EJB we need to add a dependency to the EJB deployment plan that is openejb-jar.xml. The above element can be obtained automatically from Geronimo Database Pool wizard. Select usage against the database pool jdbc/userds

  2. In the WEB Project. Under WEB-INF, Edit geronimo-web.xml and add the following
    Code Block
    titleEJB dependency
    borderStylesolid
    
    <sys:dependencies>
           <sys:dependency>
                <sys:groupId>default</sys:groupId>
          		<sys:artifactId>StatelessSessionEJB</sys:artifactId>
          		<sys:version>1.0</sys:version>
          		<sys:type>car</sys:type>
           </sys:dependency>        
    </sys:dependencies>
    
    Finally the geronimo-web.xml will look like this
    Code Block
    titlegeronimo-web.xml
    borderStylesolid
    
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1" xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1" xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1">
      <sys:environment>
        <sys:moduleId>
          <sys:groupId>default</sys:groupId>
          <sys:artifactId>ApplicationClient</sys:artifactId>
          <sys:version>1.0</sys:version>
          <sys:type>car</sys:type>
        </sys:moduleId>
        
    In the WEB Project. Under WEB-INF, Edit geronimo-web.xml and add the following
    Code Block
    titleEJB dependency
    borderStylesolid
    
    <sys:dependencies>
           <sys:dependency>
                <sys:groupId>default</sys:groupId>
          		<sys:artifactId>StatelessSessionEJB</sys:artifactId>
          		<sys:version>1.0</sys:version>
          		<sys:type>car</sys:type>
           </sys:dependency>        
    </sys:dependencies>
      </sys:environment>
      <context-root>/ApplicationClient</context-root>
    </web-app>
    
  3. Right click the ApplicationClient Project and select properties. Select Java Build Path->Projects. Click add and add Stateless Session EJB. This is required for the compilation of the Clien Client code.

Deploy and Run

Warning
titlewarning

Due to limitation with Geronimo Eclipse Plugin, you will have to export the Stateless Session EJB project and Web Application project as a jar and war respectively.

...