Versions Compared

Key

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

...

The Geronimo-specific deployment plan for an EJB application, which is usually packaged as an EJB JAR file, is called "openejb-jar.xml". The openejb-jar.xml deployment plan is used to in conjunction with the ejb-jar.xml Java EE deplopyment deployment plan to deploy enterprise applications to the Geronimo application server. The openejb-jar.xml deployment plan is an optional file, but is typically used when deploying a EJB JAR file. It is used to map roles and resource (e.g., security roles, EJB names, database resources, JMS resources, etc.) declared in the openejb-jar.xml deployment plan to corresponding entities deployed in the server. Also, if there are any EJB container specific configurations required those setting are configured in this deployment plan as well. If the EJB module depends on any third party libraries or other services running in the server, all these third party libraries and the services are specified in the openejb-jar.xml file. Some EJB applications require class loading requirements different from the default class loading behavior. The openejb-jar.xml file allows the application deployer to configure this as well. There are many more configurations that could be done through openejb-jar.xml file depending on the requirements of the EJB application.

...

  • The <moduleId> element is used to provide the configuration name for the EJB application as deployed in the Geronimo server. It contains elements for the groupId, artifactId, version and module type. Module IDs are normally printed with slashes between the four components, such as GroupID/ArtifactID/Version/Type.

  • The <dependencies> element is used to provide the configurations and third party libraries on which the EJB module is dependent upon. These configurations and libraries are made available to the EJB module via the Geronimo classloader hierarchy.

  • The <hidden-classes> element can be used to provide some degree of control of the Geronimo classloader hierarchy, and mitigate clashes between classes loaded by the server and classes loaded by the EJB module. It is used to lists packages or classes that may be in a parent classloader, but must not be exposed to the web application. Since Geronimo is entirely open-source and utilizes many other open-source libraries it is possible that the server itself and the web application may have different requirements and/or priorities for the same open source project libraries. The <hidden-classes> element is typically used when the EJB application has requirements for a specific version of a library that is different than the version used by Geronimo itself. A simple example of this is when an EJB module uses, and most importantly includes, a version of the Log4J common logging library that is different than the version used by the Geronimo server itself. This might not provide the desired results. Thus, the <hidden-classes> element can be used to "hide" the Log4J classes loaded by all the parent classloaders of the EJB module, including those loaded by and for the Geronimo server itself, and only the Log4J classes included with the EJB module library will get loaded.

  • The <non-overridable-classes> element can also be used to provide some degree of control of the Geronimo classloader hierarchy, but in the exact opposite manner than provided by the <hidden-classes> element. This element can be used to specify a list of classes or packages which will only be loaded from the parent classloader of the EJB module to ensure that the Geronimo server's version of a libary library is used instead of the version included with the web application.

  • The <inverse-classloading> element can be used to specify that standard classloader delegation is to be reversed for this module. The Geronimo classloader delegation follows the Java EE 5 specifications, and the normal behavior is to load classes from a parent classloader (if available) before checking the current classloader. When the <inverse-classloading> element is used, this behavior is reversed and the current classloader will always be checked before looking in the parent classloader(s). This element is similar to the <hidden-classes> element since the desired behavior is to give the libraries packaged with the EJB JAR application (i.e., in META-INF/lib) precedence over anything used by the Geroimo Geronimo server itself.

  • The <suppress-default-environment> element can be used to suppress inheritance of environment by module (i.e., any default environment built by a Geronimo builder when deploying the plan will be suppressed). If the <suppress-default-environment> element is specified then any default environment build by a builder when deploying the plan will be suppressed. An example of where this is useful is when deploying a connector on an app client in a separate (standalone) module (not as part of a client plan). The connector builder defaultEnvironment includes some server modules that won't work on an app client, so you need to suppress the default environment and supply a complete environment including all parents for a non-app-client module you want to run on an app client. This element should not be used for EJB applications however.

...

Code Block
xml
xml
borderStylesolid
title<sys:environment> Example
<openejb-jar xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
             xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">

    <sys:environment>
        <sys:moduleId>
            <sys:groupId>default</sys:groupId>
            <sys:artifactId>openejb-jar-1</sys:artifactId>
            <sys:version>2.0</sys:version>
            <sys:type>ear</sys:type>
        </sys:moduleId>

        <sys:dependencies>
            <sys:dependency>
                <sys:groupId>org.apache.geronimo.testsuite</sys:groupId>
                <sys:artifactId>agent-ds</sys:artifactId>
                <sys:version>2.1.2-SNAPSHOT<1</sys:version>
                <sys:type>car</sys:type>
            </sys:dependency>

            <sys:dependency>
                <sys:groupId>org.apache.geronimo.configs</sys:groupId>
                <sys:artifactId>tomcat6</sys:artifactId>
                <sys:version>2.2-SNAPSHOT<1.1</sys:version>
                <sys:type>car</sys:type>
            </sys:dependency>
        </sys:dependencies>
    </sys:environment>

</openejb-jar>

...

Code Block
xml
xml
borderStylesolid
title<naming:cmp-connection-factory> Example
<openejb-jar xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
             xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
             xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2">

    <sys:environment>
        <sys:moduleId>
            <sys:groupId>default</sys:groupId>
            <sys:artifactId>openejb-jar-1</sys:artifactId>
            <sys:version>2.0</sys:version>
            <sys:type>ear</sys:type>
        </sys:moduleId>

        <sys:dependencies>
            <sys:dependency>
                <sys:groupId>org.apache.geronimo.testsuite</sys:groupId>
                <sys:artifactId>agent-ds</sys:artifactId>
                <sys:version>2.1.2-SNAPSHOT<1</sys:version>
                <sys:type>car</sys:type>
            </sys:dependency>

            <sys:dependency>
                <sys:groupId>org.apache.geronimo.configs</sys:groupId>
                <sys:artifactId>tomcat6</sys:artifactId>
                <sys:version>2.1.2-SNAPSHOT<1</sys:version>
                <sys:type>car</sys:type>
            </sys:dependency>
        </sys:dependencies>
    </sys:environment>

    <!-- Begin configuration for Container Managed Persistence (CMP) -->

    <naming:cmp-connection-factory>

        <naming:pattern>
            <naming:groupId>resourcelocator-pattern-groupid</naming:groupId>
            <naming:artifactId>resourcelocator-pattern-artifactid</naming:artifactId>
            <naming:version>resourcelocator-pattern-version</naming:version>
            <naming:module>resourcelocator-pattern-module</naming:module>
            <naming:name>resourcelocator-pattern-name</naming:name>
        </naming:pattern>

        <naming:resource-link>resourcelocator-resourcelink</naming:resource-link>

        <naming:url>resourcelocator-url</naming:url>

    </naming:cmp-connection-factory>

    <!-- End configuration for Container Managed Persistence (CMP) -->

</openejb-jar>

...

Code Block
xml
xml
borderStylesolid
title<ejb-ql-compiler-factory> Example
<openejb-jar xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
             xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
             xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2">

    <sys:environment>
        <sys:moduleId>
            <sys:groupId>default</sys:groupId>
            <sys:artifactId>openejb-jar-1</sys:artifactId>
            <sys:version>2.0</sys:version>
            <sys:type>ear</sys:type>
        </sys:moduleId>

        <sys:dependencies>
            <sys:dependency>
                <sys:groupId>org.apache.geronimo.testsuite</sys:groupId>
                <sys:artifactId>agent-ds</sys:artifactId>
                <sys:version>2.2-SNAPSHOT<1.1</sys:version>
                <sys:type>car</sys:type>
            </sys:dependency>

            <sys:dependency>
                <sys:groupId>org.apache.geronimo.configs</sys:groupId>
                <sys:artifactId>tomcat6</sys:artifactId>
                <sys:version>2.1.2-SNAPSHOT<1</sys:version>
                <sys:type>car</sys:type>
            </sys:dependency>
        </sys:dependencies>
    </sys:environment>

    <!-- Begin configuration for Container Managed Persistence (CMP) -->

    <naming:cmp-connection-factory>
        <naming:pattern>
            <naming:groupId>resourcelocator-pattern-groupid</naming:groupId>
            <naming:artifactId>resourcelocator-pattern-artifactid</naming:artifactId>
            <naming:version>resourcelocator-pattern-version</naming:version>
            <naming:module>resourcelocator-pattern-module</naming:module>
            <naming:name>resourcelocator-pattern-name</naming:name>
        </naming:pattern>
        <naming:resource-link>resourcelocator-resourcelink</naming:resource-link>
        <naming:url>resourcelocator-url</naming:url>
    </naming:cmp-connection-factory>

    <ejb-ql-compiler-factory>ejbqlcompilerfactory</ejb-ql-compiler-factory>

    <!-- End configuration for Container Managed Persistence (CMP) -->

</openejb-jar>

...

Code Block
xml
xml
borderStylesolid
title<db-syntax-factory> Example
<openejb-jar xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
             xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
             xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2">

    <sys:environment>
        <sys:moduleId>
            <sys:groupId>default</sys:groupId>
            <sys:artifactId>openejb-jar-1</sys:artifactId>
            <sys:version>2.0</sys:version>
            <sys:type>ear</sys:type>
        </sys:moduleId>

        <sys:dependencies>
            <sys:dependency>
                <sys:groupId>org.apache.geronimo.testsuite</sys:groupId>
                <sys:artifactId>agent-ds</sys:artifactId>
                <sys:version>2.1.2-SNAPSHOT<1</sys:version>
                <sys:type>car</sys:type>
            </sys:dependency>

            <sys:dependency>
                <sys:groupId>org.apache.geronimo.configs</sys:groupId>
                <sys:artifactId>tomcat6</sys:artifactId>
                <sys:version>2.2-SNAPSHOT<1.1</sys:version>
                <sys:type>car</sys:type>
            </sys:dependency>
        </sys:dependencies>
    </sys:environment>

    <!-- Begin configuration for Container Managed Persistence (CMP) -->

    <naming:cmp-connection-factory>
        <naming:pattern>
            <naming:groupId>resourcelocator-pattern-groupid</naming:groupId>
            <naming:artifactId>resourcelocator-pattern-artifactid</naming:artifactId>
            <naming:version>resourcelocator-pattern-version</naming:version>
            <naming:module>resourcelocator-pattern-module</naming:module>
            <naming:name>resourcelocator-pattern-name</naming:name>
        </naming:pattern>

        <naming:resource-link>resourcelocator-resourcelink</naming:resource-link>

        <naming:url>resourcelocator-url</naming:url>
    </naming:cmp-connection-factory>

    <ejb-ql-compiler-factory>ejbQlCompilerFactory</ejb-ql-compiler-factory>

    <db-syntax-factory>dbSyntaxFactory</db-syntax-factory>

    <!-- End configuration for Container Managed Persistence (CMP) -->

</openejb-jar>

...

Code Block
xml
xml
borderStylesolid
title<enforce-foreign-key-constraints> Example
<openejb-jar xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
             xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
             xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2">

    <sys:environment>
        <sys:moduleId>
            <sys:groupId>default</sys:groupId>
            <sys:artifactId>openejb-jar-1</sys:artifactId>
            <sys:version>2.0</sys:version>
            <sys:type>ear</sys:type>
        </sys:moduleId>

        <sys:dependencies>
            <sys:dependency>
                <sys:groupId>org.apache.geronimo.testsuite</sys:groupId>
                <sys:artifactId>agent-ds</sys:artifactId>
                <sys:version>2.1.2-SNAPSHOT<1</sys:version>
                <sys:type>car</sys:type>
            </sys:dependency>

            <sys:dependency>
                <sys:groupId>org.apache.geronimo.configs</sys:groupId>
                <sys:artifactId>tomcat6</sys:artifactId>
                <sys:version>2.1.2-SNAPSHOT<1</sys:version>
                <sys:type>car</sys:type>
            </sys:dependency>
        </sys:dependencies>
    </sys:environment>

    <!-- Begin configuration for Container Managed Persistence (CMP) -->

    <naming:cmp-connection-factory>
        <naming:pattern>
            <naming:groupId>resourcelocator-pattern-groupid</naming:groupId>
            <naming:artifactId>resourcelocator-pattern-artifactid</naming:artifactId>
            <naming:version>resourcelocator-pattern-version</naming:version>
            <naming:module>resourcelocator-pattern-module</naming:module>
            <naming:name>resourcelocator-pattern-name</naming:name>
        </naming:pattern>

        <naming:resource-link>resourcelocator-resourcelink</naming:resource-link>

        <naming:url>resourcelocator-url</naming:url>
    </naming:cmp-connection-factory>

    <ejb-ql-compiler-factory>ejbQlCompilerFactory</ejb-ql-compiler-factory>

    <db-syntax-factory>dbSyntaxFactory</db-syntax-factory>

    <enforce-foreign-key-constraints/>

    <!-- End configuration for Container Managed Persistence (CMP) -->

</openejb-jar>

...

EJB Entity Beans settings can include JNDI names used by remote clients, CMP settings, and COBRA CORBA configurations and resolving references.

...

An EJB session bean represents an interactive session between a single client and an application deployed on the server, and can also include JNDI names used by remote clients, CMP settings, and COBRA CORBA configurations and resolving references.

...

The <naming:resource-adapter> XML element uese uses the Geronimo Naming namespace, which is used to identify the common elements for resolving EJB references, resource references, and Web services references, and is documented here:

...