Versions Compared

Key

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

...

For example, Geronimo uses "geronimo-admin" security realm to authenticate users when they login to the Geronimo Administration Console. The deployment plan of the security realm is follows.

geronimo-admin security realm

Deployment Plan of the "geronimo-admin" security realm used by admin console application

<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
    <environment>
        <moduleId>
            <groupId>console.realm</groupId>
            <artifactId>geronimo-admin</artifactId>
            <version>1.0</version>
            <type>car</type>
        </moduleId>
        <dependencies>
            <dependency>
                <groupId>org.apache.geronimo.framework</groupId>
                <artifactId>j2ee-security</artifactId>
                <type>car</type>
            </dependency>
        </dependencies>
    </environment>
    <gbean name="geronimo-admin" class="org.apache.geronimo.security.realm.GenericSecurityRealm" xsi:type="dep:gbeanType" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <attribute name="realmName">geronimo-admin</attribute>
        <reference name="ServerInfo">
            <name>ServerInfo</name>
        </reference>
        <xml-reference name="LoginModuleConfiguration">
            <log:login-config xmlns:log="http://geronimo.apache.org/xml/ns/loginconfig-2.0">
                <log:login-module control-flag="REQUIRED" wrap-principals="false">
                    <log:login-domain-name>geronimo-admin</log:login-domain-name>
                    <log:login-module-class>org.apache.geronimo.security.realm.providers.PropertiesFileLoginModule</log:login-module-class>
                    <log:option name="groupsURI">var/security/groups.properties</log:option>
                    <log:option name="usersURI">var/security/users.properties</log:option>
                </log:login-module>
            </log:login-config>
        </xml-reference>
    </gbean>
</module>

...

The geronimo-web.xml uses XML elements from http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1Image Removed namespace and one or more namespaces mentioned in "XML Schemas - Common elements and Configuration" section above in the document. Please go through the section to know what elements does each schema describe.

For example, the following Geronimo-web.xml is the deployment plan of a web application that connects to a datasource deployed on DB2 and retrieves data.

Sample geronimo-web.xml 

Deployment plan of a web application that connects a back end Database (geronimo-web.xml)

<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
         xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
         xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
         xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
         
    <sys:environment>

        <sys:moduleId>
            <sys:groupId>samples</sys:groupId>
            <sys:artifactId>EmployeeDemo</sys:artifactId>
            <sys:version>2.1</sys:version>
            <sys:type>war</sys:type>
        </sys:moduleId>

        <sys:dependencies>

            <sys:dependency>
                <sys:groupId> samples</sys:groupId>
                <sys:artifactId>EmployeeDatasource</sys:artifactId>
                <sys:version>2.1</sys:version>
                <sys:type>rar</sys:type>
            </sys:dependency>

        </sys:dependencies>

    </sys:environment>

    <context-root>/EmployeeDemo</context-root>

    <naming:resource-ref>
        <naming:ref-name>jdbc/DataSource</naming:ref-name>
        <naming:resource-link>jdbc/EmployeeDatasource</naming:resource-link>
    </naming:resource-ref>

</web-app>

...

The deployment starts with <sys:moduleId> to provide a unique module id configuration for the web application. In dependencies section, using <sys:dependency>, a dependency on "samples/EmployeeDatasource/2.1/rar" is configured. This is the module id of Datasource that connects to DB2. The web context root is configured by <context-root>. Since there is no namespace prefix for this tag, it is going to be the default namespace http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1Image Removed. The datasource name "jdbc/Datasource" is mapped to "SystemDatasource" using <naming:resource-ref>.

...