Versions Compared

Key

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

...

<module <version>1. <dependency> <groupId>org <type>car</type> </dependency> </dependencies> </environment> <gbean <reference <log: < gbean> <
Code Block
XML
XML
borderStylesolid
titleDeployment plan of the "geronimo-admin" security realm used by Geronimo Administration Console
the<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>{code
The above security realm is deployed over two property files var/security/users.properties and var/security/groups.properties that contain user/group information using "org.apache.geronimo.security.realm.providers.PropertiesFileLoginModule". The Administration Console is a web application that uses the above security realm for user authentication.

...



Security realm deployment plan is an XML file that uses "http://geronimo.apache.org/xml/ns/deployment-1.2" Geronimo schema for ModuleId, dependency and security realm GBean configurations. The XML file uses "http://geronimo.apache.org/xml/ns/loginconfig-2.0" Geronimo schema for login module configuration.

...



The following table provides the summary of user/group repositories and corresponding login modules in Apache

...

 Geronimo
|| User/Group Repositories

...

 || Login

...

Property Files

 Modules ||
| Property Files | org.apache.geronimo.security.realm.providers.PropertiesFileLoginModule

...

Database

 |
| Database | org.apache.geronimo.security.realm.providers.SQLLoginModule

...

 |
| Ldap repository

...

 | org.apache.geronimo.security.realm.providers.LDAPLoginModule

...

 |
| Certificate Repository

...

 | org.apache.geronimo.security.realm.providers.CertificatePropertiesFileLoginModule

...

 |
| Any other

...

 | User has to supply the custom JAAS module. Admin console can be used to create and deploy a security

...

 \\
 realm over custom JAAS login modules.

...

 |
Depending on the type of the login module, the options for configuration changes. Geronimo Administration Console enables users to create and deploy security realms using all the above mentioned login modules.

...



Once a security realm is deployed, it's available for any JEE5 application deployed in Apache Geronimo to map declared roles to actual users/groups through a Geronimo deployment plan.

h2.

...

Resources

Applications

...

 Resources


h1. Applications

An enterprise application archive (EAR) can consist of several application modules. The application modules can be Web Application Archives (WAR) , EJB modules (JAR), application client modules (JAR) or Resource Archive modules (RAR). User can either deploy these modules individually or bundle them into a single EAR file and deploy the EAR file.

...



When deployed individually, each application module should accompany a Geronimo deployment plan to map declared resources names, ejb names, security roles, JMS roles to corresponding actual entities deployed in the server. The Geronimo deployment plans also contain any Geronimo specific settings and configurations. When deployed as a single bundle (EAR), user can create a single Geronimo deployment plan to accomplish all the mappings, settings and configurations.

...



The following table summarizes different JEE5 modules and corresponding Geronimo deployment plans accompany them.

...

File

...

Standard JEE deployment descriptors

...

Apache Geronimo specific Deployment plan

...

Enterprise Web application archive (EAR)

...

application.xm


|| File || Standard JEE deployment descriptors || Apache Geronimo specific Deployment plan ||
| Enterprise Web application archive (EAR) | application.xml | geronimo-application.xml

...

 |
| Web Application Archive (WAR)

...

 | web.xml

...

 | geronimo-web.xml

...

 |
| J2EE Connector resources archive (RAR)

...

 | ra.xml

...

 | geronimo-ra.xml

...

 |
| J2EE client application archive (JAR)

...

 | client.xml

...

 | geronimo-application-client.xml

...

 |
| JAR containing EJBs

...

 | ejb-jar.xml

...

 | openejb-jar.xml

...

 |

h2.
Web Application deployment plan (geronimo-web.xml

...

)

In the geronimo-

...

web.xml file, application deployer maps the security roles, ejb names, database resources, JMS resources, etc. declared in web.xml to corresponding entities deployed in the server. In addition to that, if there are any web container specific configurations, such as Tomcat or Jetty specific, depending on the application needs, all these settings are configured as well here. If the web application depends on any third party libraries or other services running in the server, all these dependencies are declared in the plan. Some web applications require class loading requirements different from the default class loading hierarchy. The geronimo-web.xml allows application deployer to configure this as well. There are many more configurations that could be done through geronimo-web.xml depending on the needs of web application. The following sections briefly explain how geronimo-web.xml can be used configure the web container and web applications.

The geronimo-web.xml uses XML elements from http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1 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.

Deployment plan of a web application that connects to a back end Database server (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>

Code Block

Please observe the different namespace prefixes and corresponding namespaces used to configure dependencies and resource mapping.

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 Added. The datasource name "jdbc/Datasource" is mapped to "SystemDatasource" using <naming:resource-ref>.

All the XML schema files are located at <GERONIMO_HOME>/schema directory. <GERONIMO_HOME> is the location where Geronimo is installed.  Please go through the XSD files to have a feel of XML tags that can be used in Geronimo-web.xml for configuring web applications.

Similarly, many container specific configurations and application security configurations are performed through other XML tags.

...