geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v3.0 > Deploying and undeploying applications
Date Mon, 24 Jan 2011 03:48:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2036/9/4/_/styles/combined.css?spaceKey=GMOxDOC30&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Deploying+and+undeploying+applications">Deploying
and undeploying applications</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~maojia508">maojia</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >When you package your <span
class="diff-changed-words">application<span class="diff-added-chars"style="background-color:
#dfd;">,</span></span> you <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">may</span>
<span class="diff-added-words"style="background-color: #dfd;">might</span> include
the deployment plan within the package or not. At deployment time, Geronimo <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">will
look</span> <span class="diff-added-words"style="background-color: #dfd;">looks</span>
for the deployment plan <span class="diff-added-words"style="background-color: #dfd;">(for
example,</span> {{geronimo-web.xml}} and deployment descriptor <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{{web.xml}}
(or</span> <span class="diff-added-words"style="background-color: #dfd;">(for
example,{{web.xml}},</span> {{geronimo-application.xml}} or {{geronimo-application-client.xml}}
depending <span class="diff-added-words"style="background-color: #dfd;">on</span>
the type of application) in the {{WEB-INF}} directory within your packaged application. If
Geronimo can not find those information it will attempt to deploy the application using defaults.
If using defaults fails you will have to either provide a deployment plan repackaged in the
application or provide an external deployment plan, in the following sections we will discuss
further these alternatives. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>h1. Via Geronimo Administration
Console{anchor:GACdeploy} <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <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/GMOxDOC30/Deploying+and+administering+applications"><img border='0'
align='middle' src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/GMOxDOC30/Deploying+and+administering+applications">Deploying
and administering applications</a></td><td width='33%' class='ScrollbarNextName'>&nbsp;<a
href="/confluence/display/GMOxDOC30/Starting+and+stopping+applications">Starting and stopping
applications</a></td><td class='ScrollbarNextIcon'><a href="/confluence/display/GMOxDOC30/Starting+and+stopping+applications"><img
border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>

<p>There are several alternatives available for Deploying and undeploying applications:</p>
<div>
<ul>
    <li><a href='#Deployingandundeployingapplications-ViaGeronimoAdministrationConsole'>Via
Geronimo Administration Console </a></li>
    <li><a href='#Deployingandundeployingapplications-Viahotdeployment'>Via hot
deployment </a></li>
    <li><a href='#Deployingandundeployingapplications-ViaDeployertool'>Via Deployer
tool </a></li>
    <li><a href='#Deployingandundeployingapplications-Viagogocommand'>Via gogo
command </a></li>
    <li><a href='#Deployingandundeployingapplications-ViaGEP'>Via GEP </a></li>
    <li><a href='#Deployingandundeployingapplications-ViaClustering'>Via Clustering
</a></li>
</ul></div>


<p>When you package your application, you might include the deployment plan within the
package or not. At deployment time, Geronimo looks for the deployment plan (for example, <tt>geronimo-web.xml</tt>
and deployment descriptor (for example,<tt>web.xml</tt>, <tt>geronimo-application.xml</tt>
or <tt>geronimo-application-client.xml</tt> depending on the type of application)
in the <tt>WEB-INF</tt> directory within your packaged application. If Geronimo
can not find those information it will attempt to deploy the application using defaults. If
using defaults fails you will have to either provide a deployment plan repackaged in the application
or provide an external deployment plan, in the following sections we will discuss further
these alternatives.</p>

<h1><a name="Deployingandundeployingapplications-ViaGeronimoAdministrationConsole"></a>Via
Geronimo Administration Console<a name="Deployingandundeployingapplications-GACdeploy"></a></h1>
<p>To install a new application via the Geronimo Administration Console the <b>Install
New Applications</b> portlet is available by selecting <b>Deployer</b> on
the <b>Console Navigation</b> menu on the left hand side. This portlet also allows
you to start automatically the application right after it was deployed.</p>

<p><span class="image-wrap" style=""><img src="/confluence/download/attachments/20645345/installnewapps.gif?version=1&amp;modificationDate=1203094987000"
style="border: 0px solid black" /></span></p>

<p>For this example we will be using the simple JSP HelloWorld sample created in the
<a href="/confluence/display/GMOxDOC30/Quick+start+-+Apache+Geronimo+for+the+impatient"
title="Quick start - Apache Geronimo for the impatient">Quick start &#45; Apache Geronimo
for the impatient</a> section. In that section however we used the <b>--inPlace</b>
deployment option, in other words we did not need to package the application into a <b>WAR</b>
file. To create the WAR file type the following command from the <b>&lt;app_home&gt;</b>
directory</p>

<p><b><tt>jar -cvf HelloWorld.war</tt></b> *</p>

<p>This WAR already has included in the package the deployment plans.</p>

<p>Back in the Geronimo Administration Console, from the <b>Install New Applications</b>
portlet click on <b>Browse</b> to specify the path to the <tt>HelloWorld.war</tt>
in the <b>Archive:</b> section. Make sure the <b>Start app after install</b>
checkbox is selected (by default is checked) and then click on <b>Install</b>.</p>

<p>You should see the " <tt>The application was successfully deployed.</tt>
" and " <tt>The application was successfully started.</tt> " confirmation messages
on the top of the portlet.</p>

<p>Another way to verify that the application has been successfully installed and started
is by checking the <b>Installed Web Applications</b> portlet which is available
by selecting <b>Web App WARs</b> on the <b>Console Navigation</b>
menu on the left hand side. You should see the application listed as <b>hello</b>
and with the status <b>running</b>.</p>

<p>Since the application we installed is <tt>HelloWold.<b>WAR</b></tt>,
we use this <b>Installed Web Applications</b> portlet. When you install an EAR,
you would check the status using the <b>Installed Application EARs</b> portlet
available by selecting <b>Application EARs</b> on the <b>Console Navigation</b>
menu on the left hand side. The installation procedure is the same for both WAR and EAR applications.</p>

<p>To remove the applications through the Geronimo Administration Console you would
use these two portlets, either the <b>Installed Web Applications</b> or the <b>Installed
Application EARs</b> portlets depending on the application to uninstall.</p>

<p><span class="image-wrap" style=""><img src="/confluence/download/attachments/20645345/adminapps.gif?version=1&amp;modificationDate=1203094908000"
style="border: 0px solid black" /></span></p>

<p>For our example, access the <b>Installed Web Applications</b> portlet
and click on <b>Uninstall</b> for the <b>Component Name</b> listing
<b><tt>sample.applications/HelloWorldApp/1.0/war</tt></b>. This will
stop the application first and then uninstall it.  The confirmation message " <tt>Uninstalled
application</tt> " should be listed at the bottom of the portlet.</p>

<p>These are the basic steps for installing and uninstalling applications via the Geronimo
Administration Console, the following two sections will focus on the command line options.</p>

<h1><a name="Deployingandundeployingapplications-Viahotdeployment"></a>Via
hot deployment<a name="Deployingandundeployingapplications-Hotdeploy"></a></h1>

<p>Apache Geronimo has support for <em>Hot Deployment</em>, which means
that you can copy an application JAR file into the <tt>&lt;geronimo_home&gt;/deploy</tt>
directory and the application will be deployed automatically. This will also work for uninstalling
or refreshing applications previously deployed via this method. Alternatively, you may also
copy the <em>directory</em> (unpacked) for the application module instead of copying
a single JAR file.</p>

<p>Note that with this deployment method you have to include the deployment plan in
the application package, this method does not support external deployment plans. Also note
that applications deployed via the <a href="/confluence/display/GMOxDOC30/deploy" title="deploy">Deployer
tool</a> or the Geronimo Administration Console will not be listed in the <tt>&lt;geronimo_home&gt;/deploy</tt>
directory.</p>

<p>When you copy an application in the <tt>deploy</tt> directory, for example
HelloWorld.war, you will see a confirmation message in the <tt>geronimo.log</tt>
which locates in the <tt>&lt;geronimo_home&gt;/var/log</tt> directory.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
11:45:23,500 INFO  [DirectoryHotDeployer] Deploying HelloWorld.war
11:45:23,953 INFO  [DirectoryHotDeployer] Deployed sample.applications/HelloWorldApp/1.0/war
@ /hello
</pre>
</div></div>

<p>To remove the application, just delete the WAR or EAR file from the <tt>deploy</tt>
directory. When the application has been removed you should see a confirmation message in
the <tt>geronimo.log</tt> which locates in the <tt>&lt;geronimo_home&gt;/var/log</tt>
directory.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
11:46:17,953 INFO  [DirectoryHotDeployer] Undeploying HelloWorld.war
11:46:18,281 INFO  [DirectoryMonitor] Hot deployer notified that an artifact was removed:
sample.applications/HelloWorldApp/1.0/war
11:46:18,281 INFO  [DirectoryHotDeployer]     Undeployed sample.applications/HelloWorldApp/1.0/war
</pre>
</div></div>

<h1><a name="Deployingandundeployingapplications-ViaDeployertool"></a>Via
Deployer tool<a name="Deployingandundeployingapplications-deployertool"></a></h1>

<p>The deployer tool will allow you, among other things, install and uninstall applications
via a command line. In this section we will focus on just these two tasks for the sample application,
the remaining functionality is fully covered in the <a href="/confluence/display/GMOxDOC30/deploy"
title="deploy">Deployer tool</a> section.</p>

<p>To deploy the HelloWorld.war sample application using the Deployer tool open a command
line window and type the following command from the <tt>&lt;geronimo_home&gt;\bin</tt>
directory:</p>

<p><b><tt>deploy --user system --password manager deploy &lt;app_home&gt;\HelloWorld.war</tt></b></p>

<p>If your application does not include the Geronimo specific deployment plan in the
<tt>WEB-INF</tt> directory you can still, just like with the Geronimo Administration
Console, specify it externally. You just need to add to the previous command the path and
file name of the deployment plan.</p>

<p><b><tt>deploy --user system --password manager deploy &lt;app_home&gt;\HelloWorld.war
&lt;deployment_plan_home&gt;\plan.xml</tt></b></p>

<p>Note that when specifying the deployment plan externally you can use any file name
to identify that plan, there is no need to use the <tt>geronimo-XYZ.xml</tt> form.
In our example we do not need to specify any additional deployment plans as we have the Geronimo
specific ones already included in the package.</p>

<p>Once deployed you should see a confirmation message similar to this one with moduleID
<tt>sample.applications/HelloWorldApp/1.0/war</tt> assigned to this application
within your deployment plan:</p>

<p><font color="white"><div class="preformatted panel" style="background-color:
#000000;border-style: solid;border-width: 1px;"><div class="preformattedContent panelContent"
style="background-color: #000000;">
<pre>D:\geronimo-tomcat7-javaee6-3.0\bin&gt;deploy --user system --password manager
deploy \HelloWorld_1.0\HelloWorld.war
Using GERONIMO_BASE:   D:\geronimo-tomcat7-javaee6-3.0
Using GERONIMO_HOME:   D:\geronimo-tomcat7-javaee6-3.0
Using GERONIMO_TMPDIR: D:\geronimo-tomcat7-javaee6-3.0\var\temp
Using JRE_HOME:        C:\Java\jdk1.6.0_21\\jre
    Deployed sample.applications/HelloWorldApp/1.0/war @ /hello
</pre>
</div></div></font></p>

<p>As a difference from the deployment via the Geronimo Administration Console, using
the command line tool you receive instant information in the command line for confirmation.
Alternatively, if you have not yet packaged your application you could use the <b>--inPlace</b>
option for deploying your application directly from the directory you are actually developing
the application. This option is used to deploy this sample application in the <a href="/confluence/display/GMOxDOC30/Quick+start+-+Apache+Geronimo+for+the+impatient"
title="Quick start - Apache Geronimo for the impatient">Quick start &#45; Apache Geronimo
for the impatient</a> section.</p>

<p>In this case you would use this command from the <tt>&lt;geronimo_home&gt;\bin</tt>
directory:</p>

<p><b><tt>deploy --user system --password manager deploy --inPlace &lt;app_home&gt;</tt></b></p>

<p>To uninstall an application, run the following command from the <tt>&lt;geronimo_home&gt;\bin</tt>
directory using the moduleID specified in the deployment plan.</p>

<p><b><tt>deploy --user system --password manager undeploy sample.applications/HelloWorldApp/1.0/war</tt></b></p>

<p>This command will first stop the running application and then uninstall it. You should
see a confirmation message similar to this:</p>

<p><font color="white"><div class="preformatted panel" style="background-color:
#000000;border-style: solid;border-width: 1px;"><div class="preformattedContent panelContent"
style="background-color: #000000;">
<pre>D:\geronimo-tomcat7-javaee6-3.0\bin&gt;deploy --user system --password manager
undeploy sample.applications/HelloWorldApp/1.0/war
Using GERONIMO_BASE:   D:\geronimo-tomcat7-javaee6-3.0
Using GERONIMO_HOME:   D:\geronimo-tomcat7-javaee6-3.0
Using GERONIMO_TMPDIR: D:\geronimo-tomcat7-javaee6-3.0\var\temp
Using JRE_HOME:        C:\Java\jdk1.6.0_21\\jre
    Module sample.applications/HelloWorldApp/1.0/war unloaded.
    Module sample.applications/HelloWorldApp/1.0/war uninstalled.

    Undeployed sample.applications/HelloWorldApp/1.0/war
</pre>
</div></div></font></p>

<p>These are other options and commands available for this deployer tool, please visit
the <a href="/confluence/display/GMOxDOC30/Tools+and+commands" title="Tools and commands">Tools
and commands</a> section for additional details.</p>

<h1><a name="Deployingandundeployingapplications-Viagogocommand"></a>Via
gogo command<a name="Deployingandundeployingapplications-gogodeploy"></a></h1>

<p>You can also deploy or undeploy applications in Karaf shell. See <a href="/confluence/display/GMOxDOC30/gogo+commands+for+Geronimo"
title="gogo commands for Geronimo">gogo commands for Geronimo</a> for detailed information
about deploying and undeploying gogo commands.</p>

<h1><a name="Deployingandundeployingapplications-ViaGEP"></a>Via GEP<a
name="Deployingandundeployingapplications-GEPdeploy"></a></h1>

<p>You can also deploy or undeploy application in Eclipse if you have <a href="/confluence/display/GMOxDOC30/Installing+Geronimo+Eclipse+Plugin"
title="Installing Geronimo Eclipse Plugin">Geronimo Eclipse Plugin (GEP)</a> installed.
See <a href="/confluence/display/GMOxDOC30/Deploying+and+debugging+applications+using+GEP"
title="Deploying and debugging applications using GEP">Deploying and debugging applications
using GEP</a> for details about deploying and undeploying applications with GEP.</p>

<h1><a name="Deployingandundeployingapplications-ViaClustering"></a>Via
Clustering<a name="Deployingandundeployingapplications-WADIdeploy"></a></h1>

<p>WADI can now be used to support the replication of HTTP Session state among multiple
Geronimo servers. In previous releases of Geronimo, WADI could only be used along with the
Jetty configuration of Geronimo. WADI can now be used with Tomcat configurations of Geronimo.
In addition to the new session replication support, applications can now be deployed to administratively-defined
groups of Geronimo servers. This makes it easier to manage a single application across a number
of Geronimo servers. More information and details about clustered deployment can be found
at <a href="/confluence/display/GMOxDOC30/Farming+using+Deployment" title="Farming using
Deployment">Farming using Deployment</a>.</p>


    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Deploying+and+undeploying+applications">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=20645345&revisedVersion=4&originalVersion=3">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Deploying+and+undeploying+applications?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message