geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v2.2 > geronimo-application.xml
Date Wed, 16 Sep 2009 12:35:02 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=GMOxDOC22&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/GMOxDOC22/geronimo-application.xml">geronimo-application.xml</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~rickmcguire">Rick
McGuire</a>
    </h4>
     
          <br/>
     <div class="notificationGreySide">
         <style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td
width='33%' class='ScrollbarPrevName'>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/GMOxDOC22/Understanding+deployment+plans"><img border='0'
align='middle' src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/GMOxDOC22/Understanding+deployment+plans">Understanding deployment
plans</a></td><td width='33%' class='ScrollbarNextName'>&nbsp;<a
href="/confluence/display/GMOxDOC22/geronimo-application-client.xml">geronimo-application-client.xml</a></td><td
class='ScrollbarNextIcon'><a href="/confluence/display/GMOxDOC22/geronimo-application-client.xml"><img
border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>
<div>
<ul>
    <li><a href='#geronimo-application.xml-Overview'>Overview</a></li>
<ul>
    <li><a href='#geronimo-application.xml-Packaging'>Packaging</a></li>
</ul>
    <li><a href='#geronimo-application.xml-Schema'>Schema</a></li>
<ul>
    <li><a href='#geronimo-application.xml-Schematoplevelelements'>Schema top-level
elements</a></li>
<ul>
    <li><a href='#geronimo-application.xml-%3Csys%3Aenvironment%3E'>&lt;sys:environment&gt;</a></li>
    <li><a href='#geronimo-application.xml-%3Cmodule%3E'>&lt;module&gt;</a></li>
    <li><a href='#geronimo-application.xml-%3Cextmodule%3E'>&lt;ext-module&gt;</a></li>
    <li><a href='#geronimo-application.xml-%3Csec%3Asecurity%3E'>&lt;sec:security&gt;</a></li>
    <li><a href='#geronimo-application.xml-%3Csys%3Aservice%3E'>&lt;sys:service&gt;</a></li>
</ul>
</ul>
</ul></div>

<h1><a name="geronimo-application.xml-Overview"></a>Overview</h1>
<p>The Geronimo deployment plan for an enterprise application, which is usually packaged
as a EAR file, is called "<b>geronimo-application.xml</b>". The <b>geronimo-application.xml</b>
deployment plan is used in conjunction with the <b>application.xml</b> JAVA EE
deployment plan to deploy enterprise applications consisting of Web Application WAR(s), EJB
JAR(s), client application JAR(s), JCA connector JAR(s), and resource adapter module RAR(s)
to the Geronimo application server.  The <b>geronimo-application.xml</b> deployment
plan is an optional file, but is typically used when deploying an EAR file.  It is used to
specify a moduleId for the deployed module, any third party dependencies, security options,
and services.</p>

<h2><a name="geronimo-application.xml-Packaging"></a>Packaging</h2>
<p>The <b>geronimo-application.xml</b> deployment plan can be packaged as
follows:</p>
<ol>
	<li>Embedded in an EAR file. In this case, a <b>geronimo-application.xml</b>
file must be placed in the <b>/META-INF</b> directory of the EAR, which is the
same place where the <b>application.xml</b> file must be located.
<br clear="all" />
<br clear="all" /></li>
	<li>Maintained separately from the EAR file. In this case, the path to the file must
be provided to the appropriate Geronimo deployer (e.g., command-line or console). Note that
in this case, the filename can be named something other than <b>geronimo-application.xml</b>
but must adhere to the same schema.</li>
</ol>


<h1><a name="geronimo-application.xml-Schema"></a>Schema</h1>
<p>The <b>geronimo-application.xml</b> deployment plan is defined by the
<b>geronimo-application-2.0.xsd</b> schema located in the <b>&lt;geronimo_home&gt;/schema/</b>
subdirectory of the main Geronimo installation directory. The <b>geronimo-application-2.0.xsd</b>
schema is briefly described here:</p>

<p><a href="http://geronimo.apache.org/schemas-2.1/docs/geronimo-application-2.0.xsd.html"
rel="nofollow">http://geronimo.apache.org/schemas-2.1/docs/geronimo-application-2.0.xsd.html</a></p>

<h2><a name="geronimo-application.xml-Schematoplevelelements"></a>Schema
top-level elements</h2>
<p>The root XML element in the <b>geronimo-application-2.0.xsd</b> schema
is the <b>&lt;application&gt;</b> element. The top-level XML elements
of the <b>&lt;application&gt;</b> root element are described in the sections
below. The deployment plan should always use the Web application namespace, and it typically
requires elements from Geronimo System and Geronimo Security namespaces. Additionally, it
has an attribute to identify its name. A typical deployment for <b>geronimo-application.xml</b>
can be presented as follows:</p>

<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>geronimo-application.xml
Example</b></div><div class="codeContent panelContent">
<pre class="code-xml">
&lt;app:application <span class="code-keyword">xmlns:app</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/application-2.0"</span>
             <span class="code-keyword">xmlns:sys</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>
             <span class="code-keyword">xmlns:sec</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/security-2.0"</span>
             application-name=<span class="code-quote">"SampleApplicationName"</span>&gt;

             ...
<span class="code-tag">&lt;/app:application&gt;</span>

</pre>
</div></div>

<h3><a name="geronimo-application.xml-%3Csys%3Aenvironment%3E"></a>&lt;sys:environment&gt;</h3>
<p>The <b>&lt;sys:environment&gt;</b> XML element uses the Geronimo
System namespace, which is used to specify the common elements for common libraries and module-scoped
services, and is described here: </p>

<ul>
	<li><a href="http://geronimo.apache.org/schemas-2.1/docs/geronimo-module-1.2.xsd.html"
rel="nofollow">http://geronimo.apache.org/schemas-2.1/docs/geronimo-module-1.2.xsd.html</a></li>
</ul>


<p>The <b>&lt;sys:environment&gt;</b> element contains the following
elements:</p>

<ul>
	<li>The <b>&lt;moduleId&gt;</b> element is used to provide the
configuration name for the web application as deployed in the Geronimo server. It contains
elements for the <b>groupId</b>, <b>artifactId</b>, <b>version</b>
and module <b>type</b>. Module IDs are normally printed with slashes between the
four components, such as <b>GroupID/ArtifactID/Version/Type</b>.
<br clear="all" /> 
<br clear="all" /></li>
	<li>The <b>&lt;dependencies&gt;</b> element is used to provide
the configurations and third party libraries on which the web module is dependent upon. These
configurations and libraries are made available to the web module via the Geronimo classloader
hierarchy.
<br clear="all" /> 
<br clear="all" /></li>
	<li>The <b>&lt;hidden-classes&gt;</b> 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 web application. 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 <b>&lt;hidden-classes&gt;</b>
element is typically used when the web 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 a web application uses, and most importantly includes,  a version of the <b>Log4J</b>
common logging library that is different than the version used by the Geronimo server itself.
This might not provide the desired results.  Thus, the <b>&lt;hidden-classes&gt;</b>
element can be used to "hide" the Log4J classes loaded by all the parent classloaders of the
web application module, including those loaded by and for the Geronimo server itself, and
only the Log4J classes included with the web application library will get loaded.
<br clear="all" /> 
<br clear="all" /></li>
	<li>The <b>&lt;non-overridable-classes&gt;</b> 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 <b>&lt;hidden-classes&gt;</b>
element. This element can be used to specify a list of classes or packages which will <b>only</b>
be loaded from the parent classloader of the web application module to ensure that the Geronimo
server's version of a libary is used instead of the version included with the web application.
<br clear="all" /> 
<br clear="all" /></li>
	<li>The <b>&lt;inverse-classloading&gt;</b> 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 <b>&lt;inverse-classloading&gt;</b> 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 <b>&lt;hidden-classes&gt;</b>
element since the desired behavior is to give the libraries packaged with the web application
(i.e., in WEB-INF/lib) precedence over anything used by the Geroimo server itself.
<br clear="all" /> 
<br clear="all" /></li>
	<li>The <b>&lt;suppress-default-environment&gt;</b> 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 <b>&lt;suppress-default-environment&gt;</b>
element is specified then any default environment built 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 applications however.</li>
</ul>


<p>An example <b>geronimo-application.xml file</b> is shown below using
the <b>&lt;sys:environment&gt;</b> elements:</p>

<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>&lt;sys:environment&gt;
example</b></div><div class="codeContent panelContent">
<pre class="code-xml">
&lt;app:application
  <span class="code-keyword">xmlns:conn</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"</span>
  <span class="code-keyword">xmlns:dep</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>
  <span class="code-keyword">xmlns:app</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/application-2.0"</span>
  application-name=<span class="code-quote">"SampleEAR"</span>&gt;

    <span class="code-tag">&lt;dep:environment&gt;</span>

        <span class="code-tag">&lt;dep:moduleId&gt;</span>
            <span class="code-tag">&lt;dep:groupId&gt;</span>sampleear<span
class="code-tag">&lt;/dep:groupId&gt;</span>
            <span class="code-tag">&lt;dep:artifactId&gt;</span>sample-ear<span
class="code-tag">&lt;/dep:artifactId&gt;</span>
            <span class="code-tag">&lt;dep:version&gt;</span>1.0<span
class="code-tag">&lt;/dep:version&gt;</span>
            <span class="code-tag">&lt;dep:type&gt;</span>ear<span
class="code-tag">&lt;/dep:type&gt;</span>
        <span class="code-tag">&lt;/dep:moduleId&gt;</span>

        <span class="code-tag">&lt;dep:dependencies&gt;</span>
            <span class="code-tag">&lt;dep:dependency&gt;</span>
                <span class="code-tag">&lt;dep:groupId&gt;</span>org.apache.geronimo.configs<span
class="code-tag">&lt;/dep:groupId&gt;</span>
                <span class="code-tag">&lt;dep:artifactId&gt;</span>tomcat6<span
class="code-tag">&lt;/dep:artifactId&gt;</span>
                <span class="code-tag">&lt;dep:version&gt;</span>2.2-SNAPSHOT<span
class="code-tag">&lt;/dep:version&gt;</span>
                <span class="code-tag">&lt;dep:type&gt;</span>car<span
class="code-tag">&lt;/dep:type&gt;</span>
            <span class="code-tag">&lt;/dep:dependency&gt;</span>

            <span class="code-tag">&lt;dep:dependency&gt;</span>
                <span class="code-tag">&lt;dep:groupId&gt;</span>default<span
class="code-tag">&lt;/dep:groupId&gt;</span>
                <span class="code-tag">&lt;dep:artifactId&gt;</span>geronim-web-4<span
class="code-tag">&lt;/dep:artifactId&gt;</span>
                <span class="code-tag">&lt;dep:version&gt;</span>1.0<span
class="code-tag">&lt;/dep:version&gt;</span>
                <span class="code-tag">&lt;dep:type&gt;</span>car<span
class="code-tag">&lt;/dep:type&gt;</span>
            <span class="code-tag">&lt;/dep:dependency&gt;</span>
        <span class="code-tag">&lt;/dep:dependencies&gt;</span>

    <span class="code-tag">&lt;/dep:environment&gt;</span>

<span class="code-tag">&lt;/app:application&gt;</span>
</pre>
</div></div> 

<h3><a name="geronimo-application.xml-%3Cmodule%3E"></a>&lt;module&gt;</h3>
<p>The <b>&lt;module&gt;</b> uses the Geronimo default namespace
for a geronimo-application.xml file that is described here:</p>
<ul>
	<li><a href="http://geronimo.apache.org/schemas-2.1/docs/geronimo-application-2.0.xsd.html"
rel="nofollow">http://geronimo.apache.org/schemas-2.1/docs/geronimo-application-2.0.xsd.html</a></li>
</ul>


<p>This element is used to define a single Java EE module and contains one of the following
elements to identify the module:</p>
<ul>
	<li><b>&lt;connector&gt;</b> holds the location of a Java EE Connector
module. Must match the same element in <b>application.xml</b>.
<br clear="all" />
<br clear="all" /></li>
	<li><b>&lt;ejb&gt;</b> holds the location of an EJB module. Must
match the same element in <b>application.xml</b>.
<br clear="all" />
<br clear="all" /></li>
	<li><b>&lt;java&gt;</b> holds the location of a client application
module. Must match the same element in <b>application.xml</b>.
<br clear="all" />
<br clear="all" /></li>
	<li><b>&lt;web&gt;</b> holds the location of a web application
module. Must match <b>&lt;web-uri&gt;</b> in <b>application.xml</b>.</li>
</ul>


<p>The &lt;module&gt; element also contains an optional &lt;alt-dd&gt;
element that specifies an optional URI to the post-assembly version of the deployment descriptor
file for a particular Java EE module.  If &lt;alt-dd&gt; is not specified, the deployer
must read the deployment descriptor from the default location and file name required by the
respective component specification.</p>

<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>&lt;module&gt;
example</b></div><div class="codeContent panelContent">
<pre class="code-xml">
&lt;application 
  xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/application-2.0"</span>

  <span class="code-keyword">xmlns:sys</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>

  application-name=<span class="code-quote">"MDBSampleEAR"</span>&gt;

  <span class="code-tag">&lt;module&gt;</span>
    <span class="code-tag">&lt;ejb&gt;</span>example-ejb.jar<span class="code-tag">&lt;/ejb&gt;</span>
    <span class="code-tag">&lt;alt-dd&gt;</span>dds/my-ejb-geronimo-plan.xml<span
class="code-tag">&lt;/alt-dd&gt;</span>
  <span class="code-tag">&lt;/module&gt;</span>
  <span class="code-tag">&lt;module&gt;</span>
    <span class="code-tag">&lt;web&gt;</span>
      <span class="code-tag">&lt;web-uri&gt;</span>example-web.war<span
class="code-tag">&lt;/web-uri&gt;</span>
      <span class="code-tag">&lt;context-root&gt;</span>example<span
class="code-tag">&lt;/context-root&gt;</span>
    <span class="code-tag">&lt;/web&gt;</span>
  <span class="code-tag">&lt;/module&gt;</span>

<span class="code-tag">&lt;/application&gt;</span>
</pre>
</div></div>

<p>Then the Geronimo deployment plan could include separate deployment plans for both
modules like this:</p>

<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>&lt;module&gt;
example</b></div><div class="codeContent panelContent">
<pre class="code-xml">
&lt;application 
  xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/application-2.0"</span>

  <span class="code-keyword">xmlns:sys</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>

  application-name=<span class="code-quote">"MDBSampleEAR"</span>&gt;

  <span class="code-tag">&lt;module&gt;</span>
    <span class="code-tag">&lt;ejb&gt;</span>example-ejb.jar<span class="code-tag">&lt;/ejb&gt;</span>
    <span class="code-tag">&lt;alt-dd&gt;</span>dds/my-ejb-jar.xml<span
class="code-tag">&lt;/alt-dd&gt;</span>
  <span class="code-tag">&lt;/module&gt;</span>
  <span class="code-tag">&lt;module&gt;</span>
    <span class="code-tag">&lt;web&gt;</span>
      <span class="code-tag">&lt;web-uri&gt;</span>example-web.war<span
class="code-tag">&lt;/web-uri&gt;</span>
      &lt;web-app xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/web-1.0"</span>
               <span class="code-keyword">xmlns:naming</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/naming-1.0"</span>&gt;
        <span class="code-tag">&lt;naming:resource-ref&gt;</span>
          <span class="code-tag">&lt;naming:ref-name&gt;</span>jms/AConnectionFactory<span
class="code-tag">&lt;/naming:ref-name&gt;</span>
          <span class="code-tag">&lt;naming:resource-link&gt;</span>MyConnectionFactory<span
class="code-tag">&lt;/naming:resource-link&gt;</span>
        <span class="code-tag">&lt;/naming:resource-ref&gt;</span>
      <span class="code-tag">&lt;/web-app&gt;</span>
    <span class="code-tag">&lt;/web&gt;</span>
  <span class="code-tag">&lt;/module&gt;</span>

<span class="code-tag">&lt;/application&gt;</span>
</pre>
</div></div>

<p>In this case, the EJB deployment plan is stored inside the EAR (in a directory called
dds/ that also holds a replacement for ejb-jar.xml for that module).  The Web application
deployment plan is right there inside the EAR deployment plan, in its entirety.</p>

<h3><a name="geronimo-application.xml-%3Cextmodule%3E"></a>&lt;ext-module&gt;</h3>
<p>The <b>&lt;ext-module&gt;</b> uses the Geronimo default namespace
for a geronimo-application.xml file that is described here:</p>
<ul>
	<li><a href="http://geronimo.apache.org/schemas-2.1/docs/geronimo-application-2.0.xsd.html"
rel="nofollow">http://geronimo.apache.org/schemas-2.1/docs/geronimo-application-2.0.xsd.html</a></li>
</ul>


<p>This element can be used to define a single external Jave EE module that is being
deployed or redeployed and contains one of the following elements to identify the module:</p>
<ul>
	<li><b>&lt;connector&gt;</b> holds the location of a Java EE Connector
module. Must match the same element in <b>application.xml</b>.
<br clear="all" />
<br clear="all" /></li>
	<li><b>&lt;ejb&gt;</b> holds the location of an EJB module. Must
match the same element in <b>application.xml</b>.
<br clear="all" />
<br clear="all" /></li>
	<li><b>&lt;java&gt;</b> holds the location of a client application
module. Must match the same element in <b>application.xml</b>.
<br clear="all" />
<br clear="all" /></li>
	<li><b>&lt;web&gt;</b> holds the location of a web application
module. Must match <b>&lt;web-uri&gt;</b> in <b>application.xml</b>.</li>
</ul>


<p>The &lt;ext-module&gt; element also contains either an &lt;internal-path&gt;
or an <b>&lt;external-path&gt;</b>.  <b>&lt;internal-path&gt;</b>
indicates that the module is packaged in the EAR and the path specified is relative to the
enterprise application package main directory.  <b>&lt;external-path&gt;</b>
indicates that the module is not part of the enterprise application and must be located by
matching the supplied pattern in a Geronimo repository.</p>

<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>&lt;ext-module&gt;
example</b></div><div class="codeContent panelContent">
<pre class="code-xml">
&lt;application 
  xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/application-2.0"</span>

  <span class="code-keyword">xmlns:sys</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>

  application-name=<span class="code-quote">"MDBSampleEAR"</span>&gt;

  <span class="code-tag">&lt;sys:environment&gt;</span>
    <span class="code-tag">&lt;sys:moduleId&gt;</span>
      <span class="code-tag">&lt;sys:groupId&gt;</span>default<span
class="code-tag">&lt;/sys:groupId&gt;</span>
      <span class="code-tag">&lt;sys:artifactId&gt;</span>MDBSampleEAR<span
class="code-tag">&lt;/sys:artifactId&gt;</span>
      <span class="code-tag">&lt;sys:version&gt;</span>1.0<span class="code-tag">&lt;/sys:version&gt;</span>
      <span class="code-tag">&lt;sys:type&gt;</span>car<span class="code-tag">&lt;/sys:type&gt;</span>
    <span class="code-tag">&lt;/sys:moduleId&gt;</span>
  <span class="code-tag">&lt;/sys:environment&gt;</span>
  
  <span class="code-tag">&lt;ext-module&gt;</span>
    <span class="code-tag">&lt;connector&gt;</span>TopicJMSSample<span
class="code-tag">&lt;/connector&gt;</span>
    <span class="code-tag">&lt;external-path&gt;</span>
     <span class="code-tag">&lt;sys:groupId&gt;</span>org.apache.geronimo.modules<span
class="code-tag">&lt;/sys:groupId&gt;</span>
     <span class="code-tag">&lt;sys:artifactId&gt;</span>geronimo-activemq-ra<span
class="code-tag">&lt;/sys:artifactId&gt;</span>
     <span class="code-tag">&lt;sys:version&gt;</span>2.1<span class="code-tag">&lt;/sys:version&gt;</span>
    <span class="code-tag">&lt;/external-path&gt;</span>
    <span class="code-tag">&lt;connector xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"</span>&gt;</span>
     <span class="code-tag">&lt;resourceadapter&gt;</span>
      <span class="code-tag"><span class="code-comment">&lt;!--how to connect
to the JMS Server--&gt;</span></span>
      <span class="code-tag">&lt;resourceadapter-instance&gt;</span>
       <span class="code-tag">&lt;resourceadapter-name&gt;</span>TradeJMSResources<span
class="code-tag">&lt;/resourceadapter-name&gt;</span>
       <span class="code-tag">&lt;config-property-setting name=<span class="code-quote">"ServerUrl"</span>&gt;</span>tcp://localhost:61616<span
class="code-tag">&lt;/config-property-setting&gt;</span>
       <span class="code-tag">&lt;config-property-setting name=<span class="code-quote">"UserName"</span>&gt;</span>not
needed<span class="code-tag">&lt;/config-property-setting&gt;</span>
       <span class="code-tag">&lt;config-property-setting name=<span class="code-quote">"Password"</span>&gt;</span>not
needed<span class="code-tag">&lt;/config-property-setting&gt;</span>
       <span class="code-tag">&lt;workmanager&gt;</span>
        <span class="code-tag">&lt;gbean-link&gt;</span>DefaultWorkManager<span
class="code-tag">&lt;/gbean-link&gt;</span>
       <span class="code-tag">&lt;/workmanager&gt;</span>
      <span class="code-tag">&lt;/resourceadapter-instance&gt;</span>
        
      <span class="code-tag"><span class="code-comment">&lt;!--defines a ConnectionFactory--&gt;</span></span>
      <span class="code-tag">&lt;outbound-resourceadapter&gt;</span>
       <span class="code-tag">&lt;connection-definition&gt;</span>
        <span class="code-tag">&lt;connectionfactory-interface&gt;</span>javax.jms.ConnectionFactory<span
class="code-tag">&lt;/connectionfactory-interface&gt;</span>
        <span class="code-tag">&lt;connectiondefinition-instance&gt;</span>
         <span class="code-tag">&lt;name&gt;</span>jms/TopicConnectionFactory<span
class="code-tag">&lt;/name&gt;</span>
         <span class="code-tag">&lt;implemented-interface&gt;</span>javax.jms.TopicConnectionFactory<span
class="code-tag">&lt;/implemented-interface&gt;</span>
         <span class="code-tag">&lt;connectionmanager&gt;</span>
          <span class="code-tag">&lt;xa-transaction&gt;</span>
           <span class="code-tag">&lt;transaction-caching/&gt;</span>
          <span class="code-tag">&lt;/xa-transaction&gt;</span>
          <span class="code-tag">&lt;single-pool&gt;</span>
           <span class="code-tag">&lt;max-size&gt;</span>10<span class="code-tag">&lt;/max-size&gt;</span>
           <span class="code-tag">&lt;min-size&gt;</span>0<span class="code-tag">&lt;/min-size&gt;</span>
           <span class="code-tag">&lt;blocking-timeout-milliseconds&gt;</span>5000<span
class="code-tag">&lt;/blocking-timeout-milliseconds&gt;</span>
           <span class="code-tag">&lt;idle-timeout-minutes&gt;</span>0<span
class="code-tag">&lt;/idle-timeout-minutes&gt;</span>
           <span class="code-tag">&lt;match-one/&gt;</span>
          <span class="code-tag">&lt;/single-pool&gt;</span>
         <span class="code-tag">&lt;/connectionmanager&gt;</span>
        <span class="code-tag">&lt;/connectiondefinition-instance&gt;</span>
       <span class="code-tag">&lt;/connection-definition&gt;</span>
      <span class="code-tag">&lt;/outbound-resourceadapter&gt;</span>
     <span class="code-tag">&lt;/resourceadapter&gt;</span>
     <span class="code-tag">&lt;adminobject&gt;</span>
      <span class="code-tag">&lt;adminobject-interface&gt;</span>javax.jms.Topic<span
class="code-tag">&lt;/adminobject-interface&gt;</span>
      <span class="code-tag">&lt;adminobject-class&gt;</span>org.activemq.message.ActiveMQTopic<span
class="code-tag">&lt;/adminobject-class&gt;</span>
      <span class="code-tag">&lt;adminobject-instance&gt;</span>
       <span class="code-tag">&lt;message-destination-name&gt;</span>TextMessageTopic<span
class="code-tag">&lt;/message-destination-name&gt;</span>
       <span class="code-tag">&lt;config-property-setting name=<span class="code-quote">"PhysicalName"</span>&gt;</span>TextMessageTopic<span
class="code-tag">&lt;/config-property-setting&gt;</span>
      <span class="code-tag">&lt;/adminobject-instance&gt;</span>
     <span class="code-tag">&lt;/adminobject&gt;</span>
    <span class="code-tag">&lt;/connector&gt;</span>
  <span class="code-tag">&lt;/ext-module&gt;</span>
<span class="code-tag">&lt;/application&gt;</span>
</pre>
</div></div>

<h3><a name="geronimo-application.xml-%3Csec%3Asecurity%3E"></a>&lt;sec:security&gt;
</h3>
<p>The <b>&lt;sec:security&gt;</b> uses the Geronimo applicaiton
namespace described here:</p>
<ul>
	<li><a href="http://geronimo.apache.org/schemas-2.1/docs/geronimo-application-2.0.xsd.html"
rel="nofollow">http://geronimo.apache.org/schemas-2.1/docs/geronimo-application-2.0.xsd.html</a></li>
</ul>


<p>It is used to map roles specified in the EAR file to roles or principals in the security
realm that will be used when deploying the module. If this optional element is present, all
web and EJB modules must make the appropriate access checks as outlined in the JACC spec.
This element groups the security role mapping settings for the application. <b>&lt;app:security&gt;</b>
contains the following elements:</p>
<ul>
	<li>The <b>&lt;doas-current-caller&gt;</b> optional element may
be set to true or false (default). If set to true, any work done by the application will be
performed as the calling Subject, instead of "as the application server". This can be used
to hook into the Java JVM security sandbox (for example, to only allow trusted users to access
the server filesystem).  It is not ususally necessary, as the application-level security features
are typically sufficient. When it is enabled, you may want to adjust the security policy used
for the server to control certain permissions by subject.
<br clear="all" />
<br clear="all" /></li>
	<li>The <b>&lt;use-context-handler&gt;</b> optional element may
be set to true or false (default). If set to true, the installed JACC policy contexts will
use PolicyContextHandlers.
<br clear="all" />
<br clear="all" /></li>
	<li>The <b>&lt;default-role&gt;</b> element is used by the the
Deployer to assign method permissions for all of the unspecified methods, either by assigning
them to security roles, or by marking them as unchecked. If the value of default-role is empty,
then the unspecified methods are marked unchecked.
<br clear="all" />
<br clear="all" /></li>
	<li>The <b>&lt;description&gt;</b> element holds the description.
<br clear="all" />
<br clear="all" /></li>
	<li>The <b>&lt;credential-store-ref&gt;</b> element holds the pattern
for matching a module.
<br clear="all" />
<br clear="all" /></li>
	<li>The <b>&lt;default-subject&gt;</b> element provides a description,
realm, and id.
<br clear="all" />
<br clear="all" /></li>
	<li>The <b>&lt;role-mappings&gt;</b> element holds the information
mapping roles declared in the <b>application.xml</b> deployment descriptor to
specific principals present in the security realms available to Geronimo.</li>
</ul>


<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>&lt;sec:security&gt;
example</b></div><div class="codeContent panelContent">
<pre class="code-xml">
&lt;application xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/application-2.0"</span>

             <span class="code-keyword">xmlns:sys</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>

             <span class="code-keyword">xmlns:sec</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/security-2.0"</span>
             application-name=<span class="code-quote">"SampleSecurityEAR"</span>&gt;

  <span class="code-tag">&lt;dep:environment&gt;</span>

    <span class="code-tag">&lt;dep:moduleId&gt;</span>
      <span class="code-tag">&lt;dep:groupId&gt;</span>sampleear<span
class="code-tag">&lt;/dep:groupId&gt;</span>
      <span class="code-tag">&lt;dep:artifactId&gt;</span>sample-ear<span
class="code-tag">&lt;/dep:artifactId&gt;</span>
      <span class="code-tag">&lt;dep:version&gt;</span>1.0<span class="code-tag">&lt;/dep:version&gt;</span>
      <span class="code-tag">&lt;dep:type&gt;</span>ear<span class="code-tag">&lt;/dep:type&gt;</span>
    <span class="code-tag">&lt;/dep:moduleId&gt;</span>

    <span class="code-tag">&lt;dep:dependencies&gt;</span>
      <span class="code-tag">&lt;dep:dependency&gt;</span>
        <span class="code-tag">&lt;dep:groupId&gt;</span>org.apache.geronimo.configs<span
class="code-tag">&lt;/dep:groupId&gt;</span>
        <span class="code-tag">&lt;dep:artifactId&gt;</span>tomcat6<span
class="code-tag">&lt;/dep:artifactId&gt;</span>
        <span class="code-tag">&lt;dep:version&gt;</span>2.2-SNAPSHOT<span
class="code-tag">&lt;/dep:version&gt;</span>
        <span class="code-tag">&lt;dep:type&gt;</span>car<span class="code-tag">&lt;/dep:type&gt;</span>
      <span class="code-tag">&lt;/dep:dependency&gt;</span>

      <span class="code-tag">&lt;dep:dependency&gt;</span>
         <span class="code-tag">&lt;dep:groupId&gt;</span>default<span
class="code-tag">&lt;/dep:groupId&gt;</span>
         <span class="code-tag">&lt;dep:artifactId&gt;</span>geronim-web-4<span
class="code-tag">&lt;/dep:artifactId&gt;</span>
         <span class="code-tag">&lt;dep:version&gt;</span>1.0<span
class="code-tag">&lt;/dep:version&gt;</span>
         <span class="code-tag">&lt;dep:type&gt;</span>car<span class="code-tag">&lt;/dep:type&gt;</span>
      <span class="code-tag">&lt;/dep:dependency&gt;</span>
    <span class="code-tag">&lt;/dep:dependencies&gt;</span>

  <span class="code-tag">&lt;/dep:environment&gt;</span>

  <span class="code-tag">&lt;sec:security use-context-handler=<span class="code-quote">"false"</span>
doas-current-caller=<span class="code-quote">"true"</span> default-role=<span
class="code-quote">"admin1"</span>&gt;</span>
    <span class="code-tag">&lt;sec:role-mappings&gt;</span>
      <span class="code-tag">&lt;sec:role role-name=<span class="code-quote">"admin-role"</span>&gt;</span>
        <span class="code-tag">&lt;sec:description&gt;</span>ability to
do everything<span class="code-tag">&lt;/sec:description&gt;</span>
      <span class="code-tag">&lt;/sec:role&gt;</span>
      <span class="code-tag">&lt;sec:role role-name=<span class="code-quote">"user-role"</span>&gt;</span>
        <span class="code-tag">&lt;sec:description&gt;</span>limited access<span
class="code-tag">&lt;/sec:description&gt;</span>
      <span class="code-tag">&lt;/sec:role&gt;</span>
    <span class="code-tag">&lt;/sec:role-mappings&gt;</span>
  <span class="code-tag">&lt;/sec:security&gt;</span>

<span class="code-tag">&lt;/application&gt;</span>
</pre>
</div></div>

<h3><a name="geronimo-application.xml-%3Csys%3Aservice%3E"></a>&lt;sys:service&gt;</h3>
<p>The <b>&lt;sys:service&gt;</b> element uses the Geronimo deployment
namespace described here:</p>
<ul>
	<li><a href="http://geronimo.apache.org/schemas-2.1/docs/geronimo-module-1.2.xsd.html"
rel="nofollow">http://geronimo.apache.org/schemas-2.1/docs/geronimo-module-1.2.xsd.html</a></li>
</ul>


<p>It is used to define GBean(s) that are configured and deployed with the application.
These additional Geronimo services will be deployed when the application is deployed (and
stopped when the application is stopped). Normally, the implementation classes for these services
are included at the server level and referenced using a dependency element.</p>
     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/GMOxDOC22/geronimo-application.xml">View
Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=93274&revisedVersion=22&originalVersion=21">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/GMOxDOC22/geronimo-application.xml?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message