Versions Compared

Key

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

...

  1. In StatefulBean project select META-INF/openejb-jar.xml and replace the existing code with following code
    Code Block
    titleopenejb-jar.xml.jsp
    borderStylesolid
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <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">
        <environment>
            <moduleId>
                <groupId>default</groupId>
                <artifactId>StatefulBean</artifactId>
                <version>1.0</version>
                <type>car</type>
            </moduleId>
            <sys:dependencies>
                <sys:dependency>
                    <sys:groupId>console.dbpool</sys:groupId>
                    <sys:artifactId>jdbc/userds</sys:artifactId>
                </sys:dependency>        
            </sys:dependencies>
        </environment>
    </openejb-jar>
    
    The above deployment plan is different from the above one in the following way
    • The namespace generated by geronimo eclipse plugin are not to AG 2.1 level. This is due to some limitation which will be fixed soon.
    • Since the ejb bean class refers to jdbc/userds datasource a <dependency> element has to be added in EJB deployment plan.
  2. In StatefulClient project select WEB-INF/web.xml and replace the existing code with the following
    Code Block
    titleweb.xml
    borderStylesolid
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
    id="WebApp_ID" version="2.5">
      <display-name>StatefulClient</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>
      <servlet>
        <description></description>
        <display-name>Controller</display-name>
        <servlet-name>Controller</servlet-name>
        <servlet-class>ejb.stateful.Controller</servlet-class>
      </servlet>
      <servlet>
        <description></description>
        <display-name>Controller1</display-name>
        <servlet-name>Controller1</servlet-name>
        <servlet-class>ejb.stateful.Controller</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>Controller</servlet-name>
        <url-pattern>/Controller</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>Controller1</servlet-name>
        <url-pattern>/Controller1</url-pattern>
      </servlet-mapping>
    </web-app>
    
  3. In StatefulClient project select WEB-INF/geronimo-web.xml and add a dependency element for the StatefulBean EJB project. THe final web deployment plan will look as follows
    Code Block
    titlegeronimo-web.xml
    borderStylesolid
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ns8:web-app xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"
                 xmlns:ns2="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2" 
                 xmlns:ns3="http://geronimo.apache.org/xml/ns/naming-1.2"
                 xmlns:ns4="http://geronimo.apache.org/xml/ns/j2ee/ejb/openejb-2.0"
                 xmlns:ns5="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
                 xmlns:ns6="http://geronimo.apache.org/xml/ns/security-2.0"  
                 xmlns:ns7="http://java.sun.com/xml/ns/persistence"
                 xmlns:ns8="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1" 
                 xmlns:ns9="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0">
        <environment>
            <moduleId>
                <groupId>default</groupId>
                <artifactId>StatefulClient</artifactId>
                <version>1.0</version>
                <type>car</type>
            </moduleId>
            <dependencies>
                <dependency>
                    <groupId>default</groupId>
                    <artifactId>StatefulBean</artifactId>
                    <version>1.0</version>
                    <type>car</type>
                </dependency>
            </dependencies>
        </environment>
        <ns8:context-root>/StatefulClient</ns8:context-root>
    </ns8:web-app>
    

...