Wiki Markup |
---|
{scrollbar} |
Wiki Markup |
Excerpt |
---|
There are several alternatives available for |
Deploying and |
undeploying applications |
- Geronimo Administration Console
- #Deployer tool (command line)
- #Hot deployment (command line)
Table of Contents |
---|
When you package your application you may include the deployment plan within the package or not. At deployment time, Geronimo will look for the deployment plan geronimo-web.xml
and deployment descriptor web.xml
deployment plans (or geronimo-application.xml
or geronimo-application-client.xml
depending the type of application) in the WEB-INF
directory within you your packaged application. If Geronimo can not find those descriptors information it will attempt to deploy the application using defaults. If using defaults fails you will have to either provide a deployment plan either repackaged in the application or providing provide an external deployment plan, in the following sections we will discuss further these alternatives.
Via Geronimo Administration Console
Anchor |
---|
...
|
...
|
To install a new application via the Geronimo Administration Console the Install New Applications portlet is available by selecting Deploy New Deployer on the Console Navigation menu on the left hand side. This portlet also allows you to start automatically the application right after it was deployed.
For this example we will be using the simple JSP HelloWorld sample created in the Quick start - Apache Geronimo for the impatient section. In that section however we used the --inPlace deployment option, in other words we did not need to package the application into a WAR file. To create the WAR file type the following command from the <app_home> directory
...
Back in the Geronimo Administration Console, from the Install New Applications portlet click on Browse to specify the path to the HelloWorld.war
in the Archive: section. Make sure the Start app after install checkbox is selected (by default is checked) and then click on Install.
...
Since the application we installed is HelloWold.WAR
, we use this portlet, when Installed Web Applications portlet. When you install an EAR, you would check the status using the Installed Application EARs portlet available by selecting Application EARs on the Console Navigation menu on the left hand side. The installation procedure is the same for both WAR and EAR applications.
...
For our example, access the Installed Web Applications portlet and click on Uninstall for the Component Name listing sample.applications/HelloWorldApp/2.0/war
. This will stop the application first and then uninstall it. The confirmation message " Uninstalled application
" should be listed at the bottom of the portlet.
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.
Via hot deployment
Anchor | ||||
---|---|---|---|---|
|
Apache Geronimo has support for Hot Deployment, which means that you can copy an application JAR file into the <geronimo_home>/deploy
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 directory (unpacked) for the application module instead of copying a single JAR file.
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 Deployer tool or the Geronimo Administration Console will not be listed in the <geronimo_home>/deploy
directory.
When you copy an application in the deploy
directory, for example HelloWorld.war, you will see a confirmation message in the geronimo.log
which locates in the <geronimo_home>/var/log
directory.
Code Block |
---|
11:45:23,500 INFO [DirectoryHotDeployer] Deploying HelloWorld.war
11:45:23,953 INFO [DirectoryHotDeployer] Deployed sample.applications/HelloWorldApp/2.0/war @ /hello
|
To remove the application, just delete the WAR or EAR file from the deploy
directory. When the application has been removed you should see a confirmation message in the geronimo.log
which locates in the <geronimo_home>/var/log
directory.
Code Block |
---|
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/2.0/war
11:46:18,281 INFO [DirectoryHotDeployer] Undeployed sample.applications/HelloWorldApp/2.0/war
|
Via Deployer tool
Anchor | ||||
---|---|---|---|---|
|
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 Deployer tool section.
To deploy the HelloWorld.war sample application using the Deployer tool open a command line window and type the following command from the <geronimo_home>\bin
directory:
deploy --user system --password manager deploy <app_home>\HelloWorld.war
If your application does not include the Geronimo specific deployment plan in the WEB-INF
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.
...
Once deployed you should see a confirmation message similar to this one with moduleID sample.applications/HelloWorldApp/2.0/war
assigned to this application within your deployment plan:
No Format bgColor #000000 borderStyle solid
D:\geronimo-tomcat6-jee5-2.0-M22\bin>deploy --user system --password manager deploy \HelloWorld_2.0\HelloWorld.war
Using GERONIMO_BASE: D:\geronimo-tomcat6-jee5-2.0-M22
Using GERONIMO_HOME: D:\geronimo-tomcat6-jee5-2.0-M22
Using GERONIMO_TMPDIR: D:\geronimo-tomcat6-jee5-2.0-M22\var\temp
Using JRE_HOME: C:\Java\jdk1.5.0_06\\jre
Deployed sample.applications/HelloWorldApp/2.0/war @
http://hcunico:8080/hello
As a difference from the deployment via the Geronimo Administration Console, using the command line tool you receive more instant information in the confirmation message. For instance you receive the Component Name (a.k.a. moduleId) and you also receive the context root and port where the application was deployed. This is very useful when installing, testing and uninstalling several different applications where it would be hard to remember all these values.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.
In this case you would use this command from the <geronimo_home>\bin
directory:
deploy --user system --password manager deploy --inplace inPlace <app_home>
The Deployer tool can also be used to list all the installed applications. The list-modules command allows you to list all the applications, it also lets you narrow down the query by asking for just the started or stopped applications. The list-modules command without additional parameter will list by default all the started applications.
To uninstall an application you may want to list it first to get the right Component Name (or moduleId). Run the following command from the <geronimo_home>\bin directory:
deploy --user system --password manager list-modules
You will receive a list similar as the one shown in the following example.
No Format bgColor #000000 borderStyle solid
D:\geronimo-tomcat6-jee5-2.0-M2\bin>deploy --user system --password manager list-modules
Using GERONIMO_BASE: D:\geronimo-tomcat6-jee5-2.0-M2
Using GERONIMO_HOME: D:\geronimo-tomcat6-jee5-2.0-M2
Using GERONIMO_TMPDIR: D:\geronimo-tomcat6-jee5-2.0-M2\var\temp
Using JRE_HOME: C:\Java\jdk1.5.0_06\\jre
Found 47 modules
+ console.dbpool/LocalDB/1.0/rar
+ console.dbpool/jdbc%2FTradeDataSource/1.0/rar
+ org.apache.geronimo.configs/activemq/2.0-M2/car
+ org.apache.geronimo.configs/activemq-broker/2.0-M2/car
+ org.apache.geronimo.configs/axis/2.0-M2/car
+ org.apache.geronimo.configs/axis-deployer/2.0-M2/car
+ org.apache.geronimo.configs/axis2/2.0-M2/car
+ org.apache.geronimo.configs/axis2-deployer/2.0-M2/car
+ org.apache.geronimo.configs/client-deployer/2.0-M2/car
+ org.apache.geronimo.configs/connector-deployer/2.0-M2/car
+ org.apache.geronimo.configs/cxf/2.0-M2/car
+ org.apache.geronimo.configs/cxf-deployer/2.0-M2/car
+ org.apache.geronimo.configs/dojo-tomcat/2.0-M2/car @ http://hcunico:8080/dojo
+ org.apache.geronimo.configs/geronimo-gbean-deployer/2.0-M2/car
+ org.apache.geronimo.configs/hot-deployer/2.0-M2/car
+ org.apache.geronimo.configs/j2ee-deployer/2.0-M2/car
+ org.apache.geronimo.configs/j2ee-security/2.0-M2/car
+ org.apache.geronimo.configs/j2ee-server/2.0-M2/car
+ org.apache.geronimo.configs/j2ee-system/2.0-M2/car
+ org.apache.geronimo.configs/javamail/2.0-M2/car
+ org.apache.geronimo.configs/jee-specs/2.0-M2/car
+ org.apache.geronimo.configs/openejb/2.0-M2/car
+ org.apache.geronimo.configs/openejb-deployer/2.0-M2/car
+ org.apache.geronimo.configs/persistence-jpa10-deployer/2.0-M2/car
+ org.apache.geronimo.configs/remote-deploy-tomcat/2.0-M2/car @ http://hcunico:8080/remote-deploy
+ org.apache.geronimo.configs/rmi-naming/2.0-M2/car
+ org.apache.geronimo.configs/sharedlib/2.0-M2/car
+ org.apache.geronimo.configs/system-database/2.0-M2/car
+ org.apache.geronimo.configs/tomcat6/2.0-M2/car
+ org.apache.geronimo.configs/tomcat6-deployer/2.0-M2/car
+ org.apache.geronimo.configs/transaction-jta11/2.0-M2/car
+ org.apache.geronimo.configs/webconsole-tomcat/2.0-M2/car
`-> standard.war @ http://hcunico:8080/console-standard
`-> framework.war @ http://hcunico:8080/console
+ org.apache.geronimo.configs/webservices-common/2.0-M2/car
+ org.apache.geronimo.configs/welcome-tomcat/2.0-M2/car @ http://hcunico:8080/
+ sample.applications/HelloWorldApp/2.0/war @ http://hcunico:8080/hello
org.apache.geronimo.configs/ca-helper-tomcat/2.0-M2/car
org.apache.geronimo.configs/client/2.0-M2/car
org.apache.geronimo.configs/client-security/2.0-M2/car
org.apache.geronimo.configs/client-system/2.0-M2/car
org.apache.geronimo.configs/client-transaction/2.0-M2/car
org.apache.geronimo.configs/directory/2.0-M2/car
org.apache.geronimo.configs/ldap-realm/2.0-M2/car
org.apache.geronimo.configs/online-deployer/2.0-M2/car
org.apache.geronimo.configs/openjpa/2.0-M2/car
org.apache.geronimo.configs/shutdown/2.0-M2/car
org.apache.geronimo.configs/transformer-agent/2.0-M2/car
org.apache.geronimo.configs/uddi-tomcat/2.0-M2/car
Look for the sample.applications/HelloWorldApp/2.0/war
entry, that is the value you will have to use when trying to uninstall the application.To uninstall the application run the following command from the <geronimo_home>\bin
directory using the Component Name you identified while listing the modulesmoduleID specified in the deployment plan.
deploy --user system --password manager undeploy sample.applications/HelloWorldApp/2.0/war
...
No Format bgColor #000000 borderStyle solid
D:\geronimo-tomcat6-jee5-2.0-M22\bin>deploy --user system --password manager undeploy sample.applications/HelloWorldApp/2.0/war
Using GERONIMO_BASE: D:\geronimo-tomcat6-jee5-2.0-M22
Using GERONIMO_HOME: D:\geronimo-tomcat6-jee5-2.0-M22
Using GERONIMO_TMPDIR: D:\geronimo-tomcat6-jee5-2.0-M22\var\temp
Using JRE_HOME: C:\Java\jdk1.5.0_06\\jre
Module sample.applications/HelloWorldApp/2.0/war unloaded.
Module sample.applications/HelloWorldApp/2.0/war uninstalled.
Undeployed sample.applications/HelloWorldApp/2.0/war
In this example you have used the same tool with three different commands:
- deploy
- list-modules
- undeploy
These are not the only These are other options and commands available for this deployer tool, please visit the Tools and commands section for additional details.
Hot deployment
Apache Geronimo has support for Hot Deployment. This means that you can copy an application JAR file into the <geronimo_home>/deploy 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 directory (unpacked) for the application module instead of copying a single JAR file.
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 Deployer tool or the Geronimo Administration Console will not be listed in the <geronimo_home>/deploy directory.
When you copy an application in the deploy directory, let's say HelloWorld.war, you will see a confirmation message in the console where Geronimo is running stating the application was deployed and the context to access that application.
No Format bgColor #000000 borderStyle solid
11:45:23,500 INFO [DirectoryHotDeployer] Deploying HelloWorld.war
11:45:23,953 INFO [DirectoryHotDeployer] Deployed sample.applications/HelloWorldApp/2.0/war @
http://hcunico:8080/hello
To remove the application, just delete the WAR or EAR file from the deploy directory. When the application has been removed you should see a confirmation message in the console where Geronimo is running stating the application was undeployed.
No Format bgColor #000000 borderStyle solid
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/2.0/war
11:46:18,281 INFO [DirectoryHotDeployer] Undeployed sample.applications/HelloWorldApp/2.0/war
Summary
Via GShell
Anchor | ||||
---|---|---|---|---|
|
You can also deploy or undeploy applications in GShell. See Deploying an Application to a Server Instance in GShell for detailed information about deploying and undeploying GShell commands.
Via GEP
Anchor | ||||
---|---|---|---|---|
|
You can also deploy or undeploy application in Eclipse if you have Geronimo Eclipse Plugin (GEP) installed. See Deploying and debugging applications using GEP for details about deploying and undeploying applications with GEP.
Via Clustering
Anchor | ||||
---|---|---|---|---|
|
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 Farming using DeploymentIn this section we has discussed three different methods for installing and uninstalling applications, one graphical, one command line and for the hot deployment you can choose command line or the GUI of your choice.
Visit the Tools and commands section for further details on the available options and parameters.