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 09:06: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 (8)</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" >{toc} <br> <br></td></tr>
            <tr><td class="diff-unchanged" >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, {{geronimo-web.xml}} and deployment descriptor
(for example,{{web.xml}}) in the {{WEB-INF}} directory within your packaged application. If
Geronimo cannot find those information, it attempts 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> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >Note that when specifying the deployment
plan externally, you can use any file name to identify that plan. You do not need to use the
{{geronimo-XYZ.xml}} form. In our example, we do not need to specify any additional deployment
plans because we have the Geronimo specific ones already included in the package. <br>
<br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">After
you deploy the application, you should see a confirmation message similar to the following
one with the moduleID {{sample.applications/HelloWorldApp/1.0/war}}, which is assigned to
this application within your deployment plan: <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">After
you deploy the application, you should see a confirmation message similar to the following
one with the moduleID {{sample.applications/HelloWorldApp/1.0/war}}, which is assigned to
this application within your deployment plan. The confirmation message is displayed in the
command window, which is different from the case when you deploy by using the Geronimo Administration
Console. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>{color:white}{noformat:borderStyle=solid|
bgColor=#000000} <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{noformat}{color} <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">The
confirmation message is displayed in the command window, which is different from the case
when you deploy by using the Geronimo Administration Console. <br>Different from the
deployment that uses 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 *--inPlace* 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 [Quick start - Apache Geronimo for
the impatient] section. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Alternatively,
if you have not yet packaged your application, you could use the *--inPlace* option for deploying
your application directly from the directory where you are actually developing the application.
This option is used to deploy this sample application in the [Quick start - Apache Geronimo
for the impatient] section. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" >In this <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">case
you would</span> <span class="diff-added-words"style="background-color: #dfd;">case,</span>
use this command from the {{&lt;geronimo_home&gt;\bin}} directory: <br></td></tr>
            <tr><td class="diff-unchanged" > <br>*{{deploy --user system
--password manager deploy --inPlace &lt;app_home&gt;}}* <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >To uninstall an application, run
the following command from the {{&lt;geronimo_home&gt;\bin}} directory <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">using</span>
<span class="diff-added-words"style="background-color: #dfd;">with</span> the
moduleID specified in the deployment plan. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>*{{deploy --user system
--password manager undeploy sample.applications/HelloWorldApp/1.0/war}}* <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >This command will <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">first</span>
stop the running application and then uninstall it. You should see a confirmation message
similar to <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">this:</span>
<span class="diff-added-words"style="background-color: #dfd;">the following one:</span>
<br></td></tr>
            <tr><td class="diff-unchanged" > <br>{color:white}{noformat:borderStyle=solid|
bgColor=#000000} <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{noformat}{color} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">The<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">s</span><span
class="diff-added-chars"style="background-color: #dfd;">r</span>e</span> are
other options and commands available for this deployer tool, please visit the [Tools and commands]
section for additional details. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>h1. Via gogo command{anchor:gogodeploy}
<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>) in the <tt>WEB-INF</tt>
directory within your packaged application. If Geronimo cannot find those information, it
attempts 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 by using the Geronimo Administration Console, select
<b>Deployer</b> on the <b>Console Navigation</b> menu on the left
side to launch the <b>Install Applications</b> portlet. You can choose to start
the application automatically right after it is deployed by selecting the <b>start application
after installation</b> check box. This check box is selected by default.</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 use the simple JSP HelloWorld sample that was 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 and did not need to package the application into a <b>WAR</b>
file. To create the WAR file type, run 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 has already included the deployment plans in the package.</p>

<p>Back in the Geronimo Administration Console, from the <b>Install New Applications</b>
portlet, click <b>Browse</b> to specify the path to <tt>HelloWorld.war</tt>
in the <b>Archive:</b> section. Make sure that the <b>Start application
after installation</b> check box is selected and then click <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 is 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 side. You should see the application listed as <b>hello</b> and
with the status <b>running</b>.</p>

<p>Because the application we installed is <tt>HelloWold.<b>WAR</b></tt>,
we use this <b>Installed Web Applications</b> portlet to verify the installation.
When you install an EAR, you would check the status by 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 side. The installation procedure is the same for both
WAR and EAR applications.</p>

<p>To remove the applications by using the Geronimo Administration Console, use either
the <b>Installed Web Applications</b> portlet 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 <b>Uninstall</b> for the application that has the <b>Component
Name</b> <b><tt>sample.applications/HelloWorldApp/1.0/war</tt></b>.
This will stop the application 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 by using 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 also works for uninstalling
or refreshing applications previously deployed by using this method. Alternatively, you can
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 because this method does not support external deployment plans. Also
note that applications deployed by using the <a href="/confluence/display/GMOxDOC30/deploy"
title="deploy">Deployer tool</a> or the Geronimo Administration Console are not listed
in the <tt>&lt;geronimo_home&gt;/deploy</tt> directory.</p>

<p>When you copy an application into the <tt>deploy</tt> directory, for
example HelloWorld.war, you will see a confirmation message in the <tt>geronimo.log</tt>,
which is located 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, 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 is located 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>You can use the deployer tool to install and uninstall applications by running a
command line. In this section, we focuses 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 by 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 the path and file name of the deployment
plan to the previous command.</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. You do not need to use the <tt>geronimo-XYZ.xml</tt> form.
In our example, we do not need to specify any additional deployment plans because we have
the Geronimo specific ones already included in the package.</p>

<p>After you deploy the application, you should see a confirmation message similar to
the following one with the moduleID <tt>sample.applications/HelloWorldApp/1.0/war</tt>,
which is assigned to this application within your deployment plan. The confirmation message
is displayed in the command window, which is different from the case when you deploy by using
the Geronimo Administration Console.</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>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 where 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, 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 with 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 stop the running application and then uninstall it. You should
see a confirmation message similar to the following one:</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>There 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=7&originalVersion=6">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