Chapter 4. Application Implementation and Deployment

Table of Contents

4.1. Application Implementation
4.2. Deployment Commands
4.3. Controlling and Monitoring Applications with WebAdmin
4.3.1. Installing Applications on a Domain
4.3.2. Uninstalling Applications From a Domain
4.3.3. Deploying Applications
4.3.4. Redeploying Applications
4.3.5. Undeploying Applications
4.3.6. Starting Applications
4.3.7. Suspending Applications
4.3.8. Adding a Server as a Target of Running Applications
4.3.9. Removing a Target Server of Running Applications
4.3.10. Checking for Information about Applications
4.4. Controlling and Monitoring Applications Using the Console Tool
4.4.1. Related Commands
4.4.2. Deploying Applications
4.4.3. Checking for Information about Applications
4.5. Deploying In Staging Mode
4.6. Deploying Applications Using a Deployment Plan
4.6.1. Deployment Plan Configurations and Operation Methods
4.6.2. Deployment Plan Installation
4.6.3. Installed Deployment Plan Verification
4.6.4. Deployment Using Deployment Plan
4.6.5. Verification of Application-Applied Deployment Plan
4.6.6. Deployment Plan Uninstallation
4.6.7. Deployment Plan and Redeployment

This chapter describes how to write Java EE application files (EAR files) and deploy them on JEUS. It also explains how to deploy applications and handle related jobs by using tools provided by JEUS.

This section describes how to write a JAVA EE application, which includes the already created modules from the previous sections, using the 'jar' utility.

Before writing an EAR file, create modules that need to be included in the file. The modules can be EJB modules (JAR files), web application modules (war files), application client modules (JAR files), or resource adapter modules (rar files). For information about how to create each module, refer to their relevant guides.

Descriptions of myApp.ear, the application shown in this section, are as follows:

  • myApp.ear is an EAR file which includes the EJB module ejb.jar, the web application module web.war, and the application client module appclient.jar.

  • myApp.ear should be installed on DAS adminServer, and then deployed on the server named server1.

The following is the process of creating an application:

The WebAdmin and console tool support the following commands. The commands also can be executed using the DeploymentManager specified in the DeploymentAPI specification.

CommandDescription
DistributeCopies application files to the target servers or clusters and prepares to run the application. If the distribution job fails in one or more target servers or clusters, the entire job will fail, and application files will be undeployed from all successful servers.
Deploy

Copies application files to the target servers or clusters, prepares to run the application, and starts the application if the previous jobs are successful.

If the distribution job fails in one or more target servers or clusters, the entire job will fail, and application files will be undeployed on all successful servers.

StartStarts applications that have been distributed on the target servers. Even if the start job fails in one or more servers, it is regarded as successful, if there are one or more servers where the application can run.
StopSuspends the running applications deployed on the target servers. The applications are not removed from the target servers, and can be started or redeployed using the application name.
UndeployStops running the applications deployed on the target servers. The applications are removed from the target servers.
Redeploy

Updates and redeploys the applications, when currently running applications are modified.

If one or more applications fail to be redeployed, all applications will be stopped.

JEUS supports the following deployment-related tasks using the WebAdmin and console tool:

TaskDescription
Adding application targets

Adds specific servers or clusters as the targets of deployed or distributed applications. This expands the targets of the applications that are currently running.

Targets can be multiple servers or clusters. If this job fails on one or more new targets, the applications will be undeployed from all the new targets, but not on the existing targets.

Removing application targets

Removes specific servers or clusters from targets of deployed or distributed applications. It reduces the number of targets of the applications.

Targets can be multiple servers or clusters.

WebAdmin is a web-based management tool used to manage JEUS.

To view the Deployed Application screen, where the applications on a domain can be managed, select [Applications] from the left menu in WebAdmin. Start from this screen to deploy an application, to install a new application on the domain, or to search for application information.


The following describes how to use the WebAdmin to install, deploy, and search myApp.ear, which was described in the previous chapter.

Caution

Jobs, to control the applications, such as deployment, distribution, undeployment, starting, and stopping, can be handled, only when the lock to modify settings has not been applied to the domain. If the lock has been applied to the domain with [Lock & Edit], apply all modified settings by clicking [Apply Changes], or cancel the modified settings by clicking [Undo ALL changes], and then proceed to process the application control jobs.

The following is the process of installing an application on a domain:

  1. To view the Deployed Application screen, select [Applications] from the left menu in the WebAdmin. On this screen, you can check the information about applications, which exist on the corresponding domain.

    Click [install] above the list of applications, to go to the screen to install a new application on the domain.

  2. Enter information, such as application ID and the file path, about the application to be installed, and then click [OK].

    Descriptions for each item are as follows:

    ItemDescription
    IdID, which is assigned to an application to be installed. If this option is not specified, an ID is created using the application name. However, for management purposes, it is recommended to specify an ID.
    PathPath of application files to be installed. The application files can be selected clicking on [Browse...].
    ForceOption to overwrite an application with an ID, which is the same as the ID of the application to be installed. When an already deployed application is modified, this option can be used to update the application files.
    UpgradeOption to specify whether to change to the JEUS DD for JEUS 7.x, if currently using the DD for JEUS 6.x or earlier version.

  3. When installation is completed, the result is displayed on the top. If the installing job is successfully completed, the application will be displayed in the application list. The status of the application is in the INSTALLED state.

Used the deploy command to enable installed applications to run. This section describes three ways of deploying applications.

  • Deploying application that are installed on a domain

  • Deploying applications that are in an application repository

  • Deploying applications by specifying the path.

Deploying Applications that are Installed on a Domain

The following is the process of deploying an application on a domain:

  1. To view the Deployed Application screen, select [Applications] from the left menu in the WebAdmin. Choose an application to deploy from the application list, and then click [deploy].

  2. Select a server where the application will be deployed, for the 'Server' field, and then click [OK].

    To distribute the application, without deploying it, select the 'Only Distribute' check box and then click [OK]. In this case, a start job is additionally required to run the application.

  3. When deployment is completed, the result is displayed on the top. If the deployment completes successfully, the application displayed in the application list will be in the RUNNING state. If only the distributing job is executed, the application will be in the DISTRIBUTED state.

Deploying Applications from an Application Repository

After adding an application repository, deploy applications that are in the repository. For more information about application repositories, and how to add or delete a repository, refer to "1.5.1. Adding, Deleting, and Searching Application Repositories".

Deploy the applications in the same way as deploying applications which are installed on a domain. When deploying is completed, the result is displayed on the top. If the deployment completes successfully, the application displayed in the application list should be in the RUNNING state.

The following is the process of deploying an application from an application repository using the WebAdmin:

Deploying Applications by Specifying the Path

The following describes how to configure the path option in the case when a parent directory cannot be added as the application repository. For more information about specifying the absolute path of an application, which is on the same machine as DAS, and deploying the application, refer to "1.6. Application Deployment by Specifying a Path".

The following is the process of deploying an application by specifying the path using the WebAdmin:

  1. To view the Deployed Application screen, select [Applications] from the left menu in WebAdmin. If the [deploy] button above the application list is clicked, the screen, where new applications can be deployed to a domain, will appear.

  2. In the 'Path' field, enter the absolute path of the application that will be deployed. Click [Input] to select the application path on DAS.

    Select server1, a server where the application will be deployed, next to the 'Server' heading, and then click the [OK] button.

    If necessary, deployment options can be configured in Advanced Options.

  3. When deployment is completed, the result is displayed on the top. If the deploying job is completed successfully, the application displayed in the application list will be in the RUNNING state.

After an application is modified, the updated application can run, after being redeployed with the redeploy command. For detailed information, see "2.2. Graceful Redeployment".

The following is the process of redeploying an application:

  1. To view the Deployed Application screen, select [Applications] from the left menu in WebAdmin. Choose an application to redeploy from the application list, and then click [redeploy].

  2. When the [redeploy] button is clicked, the following screen appears. Timeout for graceful redeployment can be specified in the 'Timeout' field. Configure other necessary items, and then click [OK].

  3. When redeployment is completed, the result is displayed on the top.

A server or cluster can be added as a target of currently running applications. Because an application, which already exists in a domain cannot be deployed on a specific server, JEUS supports the add-target command to add a server as a target. The command can be used when the application is in the RUNNING or DISTRIBUTED state.

The following is the process of adding a server as a target of the running applications:

  1. To view the Deployed Application screen, select [Applications] from the left menu in WebAdmin. To add a server than runs application services, select an application from the application list and click [add-target] next to the list.

  2. Select a server to add from the 'Server' options, and then click [OK].

  3. After adding the target, the result is displayed on the top.

  4. If the server is added successfully, you can verify the result in 'Server' and 'Running Servers' fields by selecting the corresponding application.

The following application information can be checked using WebAdmin:

  • How is the application deployed?

  • What does the application consist of?

Checking Information about Deployment of an Application

You can check to see on which servers and with what attributes the application is deployed.

The following is the process of checking the application's deployment information:

Checking for Information about Components of an Application

You can check the components that make up the application.

If an application is EAR, a list of modules, that make up the EAR application, can be checked. Select a module to check for detailed information about the module, but you should note that the information can be checked only for EJB or web modules.

You can check the EJB Bean list for an EJB module, and the servlet list for a web module.

To view the Deployed Application screen, select [Applications] from the left menu in WebAdmin. Click on an application ID from the application list to check its deployment information.


To view an application configuration information from the application deployment information screen, click a server from the list of 'Running Servers'.


If an application is an EAR application, you can check for information about the list of modules as well as the EJB and WEB modules, that make up the application.

Note

Module information can be checked only for the EJB or WEB modules. Information about client and resource modules cannot be checked.

This section describes the deployment-related console tool commands, and how to use them to deploy applications.

JEUS console tool can be used to connect to DAS to manage servers and clusters and deploy applications.

The following are console tool commands that are related to application deployment.

[Table 4.1] Application Related Commands

CommandDescription
distribute-applicationCopies the application files to target servers or clusters, and prepares the application for service.
deploy-application

Distributes the application files to target servers or clusters, and starts the application.

If an application is deployed successfully, it will be in the RUNNING state. If the application is distributed successfully, but cannot be started, it will be in the DISTRIBUTED state.

start-applicationStarts an application, that is in the DISTRIBUTED state. While this task is running, the application goes into the STARTING state. After the task has been completed successfully, the application goes into the RUNNING state.
stop-applicationStops an application in the RUNNING state. During this process, the application goes into the STOPPING state. When the task completes successfully, the application goes into the DISTRIBUTED state.
redeploy-applicationRedeploys the application when a deployed application is modified. It executes each step in the same way as the deploy command. The status in each step also matches the status in each step of the deploy command.
undeploy-applicationStops an application and removes the application from the list of targets to be distributed.
application-infoDisplays information about applications in a domain.
add-application-targetAdds a target for deployed applications. Servers and clusters can be the target.
remove-application-targetRemoves a target for deployed applications. Servers and clusters can be the target.

The following is assumed in describing how to execute runtime deployment using a console tool:

Note

For detailed information about options for the deploy-application command, refer to JEUS Reference Book. "4.2.6.4. deploy-application".

JEUS provides three methods for runtime deployment through the console tool, according to the location where an application resides. Each method deploys an application in this order: deploy, stop, start, redeploy, and undeploy commands. After executing each command, applist is executed to check the status of the application in each step.

  • Deploying applications that are installed on a domain

  • Deploy Deploying applications that are in an application repository

  • Deploying applications by specifying the path.

Deploying Applications Installed on a Domain

When an application is installed using the install-application command, it exists in the INSTALL_HOME (DOMAIN_HOME/.applications) directory.

When installing an application, the application ID can be assigned with an option. When an ID is not assigned, 'myApp_ear' becomes the application ID. After an application has been installed, it can be deployed on the target servers using the deploy-application command.

[Example 4.1] Deploy Deploying Applications Installed on a Domain

----------------------------------------------------------------
 using deploy command for application with install application
----------------------------------------------------------------
[DAS]domain1.adminServer>install-application -id myApp /usr/apphome/myApp.ear
Successfully installed the application [myApp].

[DAS]domain1.adminServer>application-info
Application information for the domain [domain1].
================================================================================
+----------+-----------+-------+----------+-----------+------------------------+
| Applicati|Application| State |  Server  |  Cluster  |    Application Path    |
|  on ID   |   Type    |       | Targets  |  Targets  |                        |
+----------+-----------+-------+----------+-----------+------------------------+
| myApp    |           | INSTAL|          |           | ${INSTALL_HOME}/myApp/m|
|          |           |LED    |          |           |yApp.ear                |
+----------+-----------+-------+----------+-----------+------------------------+
================================================================================

[DAS]domain1.adminServer>deploy myApp -servers server1
deploy the application for the application [myApp] succeeded.

[DAS]domain1.adminServer>application-info
Application information for the domain [domain1].
================================================================================
+----------+------------+---------+----------+-----------+---------------------+
| Applicati| Application|  State  |  Server  |  Cluster  |   Application Path  |
|  on ID   |    Type    |         | Targets  |  Targets  |                     |
+----------+------------+---------+----------+-----------+---------------------+
| myApp    | EAR        | RUNNING | server1  |           | ${INSTALL_HOME}/myAp|
|          |            |         |          |           |p/myApp.ear          |
+----------+------------+---------+----------+-----------+---------------------+
================================================================================

[DAS]domain1.adminServer>stop-application myApp
stop the application for the application [myApp] succeeded.


[DAS]domain1.adminServer>application-info
Application information for the domain [domain1].
================================================================================
+----------+-----------+--------+----------+----------+------------------------+
| Applicati|Application|  State |  Server  |  Cluster |    Application Path    |
|  on ID   |   Type    |        | Targets  | Targets  |                        |
+----------+-----------+--------+----------+----------+------------------------+
| myApp    | EAR       | DISTRIB| server1  |          | ${INSTALL_HOME}/myApp/m|
|          |           |UTED    |          |          |yApp.ear                |
+----------+-----------+--------+----------+----------+------------------------+
================================================================================

[DAS]domain1.adminServer>start-application myApp
start the application for the application [myApp] succeeded.

[DAS]domain1.adminServer>application-info
Application information for the domain [domain1].
================================================================================
+----------+------------+---------+----------+-----------+---------------------+
| Applicati| Application|  State  |  Server  |  Cluster  |   Application Path  |
|  on ID   |    Type    |         | Targets  |  Targets  |                     |
+----------+------------+---------+----------+-----------+---------------------+
| myApp    | EAR        | RUNNING | server1  |           | ${INSTALL_HOME}/myAp|
|          |            |         |          |           |p/myApp.ear          |
+----------+------------+---------+----------+-----------+---------------------+
================================================================================

[DAS]domain1.adminServer>redeploy-application myApp
redeploy application on das for the application [myApp] succeeded.

[DAS]domain1.adminServer>application-info
Application information for the domain [domain1].
================================================================================
+----------+------------+---------+----------+-----------+---------------------+
| Applicati| Application|  State  |  Server  |  Cluster  |   Application Path  |
|  on ID   |    Type    |         | Targets  |  Targets  |                     |
+----------+------------+---------+----------+-----------+---------------------+
| myApp    | EAR        | RUNNING | server1  |           | ${INSTALL_HOME}/myAp|
|          |            |         |          |           |p/myApp.ear          |
+----------+------------+---------+----------+-----------+---------------------+
================================================================================

[DAS]domain1.adminServer>undeploy myApp
Undeploying [myApp] (This may take time due to graceful undeployment) ..........
undeploy the application for the application [myApp] succeeded.
successfully undeployed (elapsed = 415ms)

[DAS]domain1.adminServer>application-info
Application information for the domain [domain1].
================================================================================
+----------+-----------+-------+----------+-----------+------------------------+
| Applicati|Application| State |  Server  |  Cluster  |    Application Path    |
|  on ID   |   Type    |       | Targets  |  Targets  |                        |
+----------+-----------+-------+----------+-----------+------------------------+
| myApp    | EAR       | INSTAL|          |           | ${INSTALL_HOME}/myApp/m|
|          |           |LED    |          |           |yApp.ear                |
+----------+-----------+-------+----------+-----------+------------------------+
================================================================================

[DAS]domain1.adminServer>uninstall-application myApp
uninstall the application for the application [myApp] succeeded. : Successfully deleted [myApp].

[DAS]domain1.adminServer>application-info
No applications exist in this domain.
Application information for the domain [domain1].
================================================================================
+------------+---------------+-------+------------+-------------+--------------+
| Application|  Application  | State |   Server   |   Cluster   |  Application |
|     ID     |     Type      |       |  Targets   |   Targets   |     Path     |
+------------+---------------+-------+------------+-------------+--------------+
(No data available)
================================================================================


Deploying Applications which Exist in an Application Repository

After adding an application repository, you should deploy the applications in the repository. For information about how to add and delete application repositories, see "1.5.1. Adding, Deleting, and Searching Application Repositories".

The following is the process of deploying applications from an application repository using the console tool:

[Example 4.2] Deploying Applications from an Application Repository

[DAS]domain1.adminServer>add-application-repository /home/ckek81/apps
Successfully performed the ADD operation for An application repository.
Check the results using "add-application-repository or list-application-repositories"

[DAS]domain1.suok>list-application-repositories
Application Repositories
================================================================================
+------------------------------------------------------------------------------+
|                        Path to Application Repository                        |
+------------------------------------------------------------------------------+
| /home/ckek81/apps                                                            |
+------------------------------------------------------------------------------+
================================================================================

[DAS]domain1.adminServer>application-info
Application information for the domain [domain1].
================================================================================
+----------+-----------+-------+----------+-----------+------------------------+
| Applicati|Application| State |  Server  |  Cluster  |    Application Path    |
|  on ID   |   Type    |       | Targets  |  Targets  |                        |
+----------+-----------+-------+----------+-----------+------------------------+
| exploded |           | INSTAL|          |           | /home/ckek81/apps/explo|
|          |           |LED    |          |           |ded                     |
+----------+-----------+-------+----------+-----------+------------------------+
================================================================================

[DAS]domain1.adminServer>deploy exploded -servers server1
deploy the application for the application [exploded.war] succeeded.

[DAS]domain1.adminServer>application-info
Application information for the domain [domain1].
================================================================================
+----------+------------+---------+----------+-----------+---------------------+
| Applicati| Application|  State  |  Server  |  Cluster  |   Application Path  |
|  on ID   |    Type    |         | Targets  |  Targets  |                     |
+----------+------------+---------+----------+-----------+---------------------+
| exploded | WAR        | RUNNING | server1  |           | /home/ckek81/apps/ex|
|          |            |         |          |           |ploded               |
+----------+------------+---------+----------+-----------+---------------------+
================================================================================


Deploying Application by Specifying the Path

When a parent directory cannot be added as an application repository using the console tool, the application can be deployed by specifying the path. For information about how to deploy an application, in a machine where DAS exists, using an absolute path, see "1.6. Application Deployment by Specifying a Path".

The following is the process of deploying an application by specifying the path using the console tool:


Information about myApp.ear application can be checked by using the application-info command of the console tool.

The following example checks for application information by using a console tool. For detailed information about each option, refer to JEUS Reference Book. "4.2.6.3. application-info".

[Example 4.4] Checking Application Information using Console Tool

[DAS]domain1.adminServer> application-info
Application information for the domain [domain1].
================================================================================
+----------+------------+---------+----------+-----------+---------------------+
| Applicati| Application|  State  |  Server  |  Cluster  |   Application Path  |
|  on ID   |    Type    |         | Targets  |  Targets  |                     |
+----------+------------+---------+----------+-----------+---------------------+
| myApp    | EAR        | RUNNING | server1  |           | ${INSTALL_HOME}/myAp|
|          |            |         |          |           |p/myApp.ear          |
+----------+------------+---------+----------+-----------+---------------------+
================================================================================

[DAS]domain1.adminServer>application-info -id myApp -server server1
Application information for the server [server1] in the domain [domain1].
================================================================================
+------------+-----------------+-------------+------+------------+-------------+
| Application| Application Name| Application | State|   Server   |   Cluster   |
|     ID     |                 |    Type     |      |  Targets   |   Targets   |
+------------+-----------------+-------------+------+------------+-------------+
| myApp      | myApp           | ear         | RUNNI| server1    |             |
|            |                 |             |NG    |            |             |
+------------+-----------------+-------------+------+------------+-------------+
================================================================================

[DAS]domain1.adminServer>application-info -id myApp -server server1 -detail
Application name : myApp
Application [myApp]
===============================================================
+-------------+---------------------------------+-------------+
| Module Name |        Unique Module Name       | Module Type |
+-------------+---------------------------------+-------------+
| ejb         | myApp#ejb                       | EJB         |
| appclient   | myApp#appclient                 | CAR         |
| web         | myApp#web                       | WAR         |
+-------------+---------------------------------+-------------+

To view detailed information about EJBs or web modules in an EAR, use the "-module" or "-type" option.
===============================================================

[DAS]domain1.adminServer>application-info -id myApp -server server1 -detail -module ejb
Application name : myApp
General information about the EJB module [ejb].
==============================================================
+-------------+----------------------------------------------+
| Module Name |              Unique Module Name              |
+-------------+----------------------------------------------+
| ejb         | myApp#ejb                                    |
+-------------+----------------------------------------------+
==============================================================

Beans
================================================================================
+-----------+-------------------------+-------------------+--------------------+
| Bean Name |           Type          | Local Export Name | Remote Export Name |
+-----------+-------------------------+-------------------+--------------------+
| HelloBean | StatelessSessionBean    |                   |                    |
+-----------+-------------------------+-------------------+--------------------+
================================================================================

[DAS]domain1.adminServer>application-info -id myApp -server server1 -detail -type war
Application name : myApp
There are no EJBs in this module.
General information about the web module [web].
===============================================================
+-------------+--------------------------------+--------------+
| Module Name |       Unique Module Name       | Context Path |
+-------------+--------------------------------+--------------+
| web         | myApp#web                      | /hello       |
+-------------+--------------------------------+--------------+
===============================================================

Servlets
================================================================================
+---------+------------------+-------+-------+-----------+---------+-----------+
|   Name  |       Class      | State | Count | Attribute | RegType |URLPatterns|
+---------+------------------+-------+-------+-----------+---------+-----------+
| HelloSer| dvt.deployment.se| READY |     0 | SYNC      | WEB_XML | /HelloServ|
|vlet     |rvlet.HelloServlet|       |       |           |         |let        |
+---------+------------------+-------+-------+-----------+---------+-----------+
================================================================================

Filters
================================================================================
+------+-------+--------------+-----------+----------------------+-------------+
| Name | Class |   Attribute  |  RegType  |      URLPatterns     |   Servlets  |
+------+-------+--------------+-----------+----------------------+-------------+
(No data available)
================================================================================

Listeners
================================================
+------+------+--------------------------------+
| Name | Type |             RegType            |
+------+------+--------------------------------+
(No data available)
================================================

EJBs
================================================================================
+-----------+------+-------------------------+---------------------------------+
| Bean Name | Type |    Local Export Name    |        Remote Export Name       |
+-----------+------+-------------------------+---------------------------------+
(No data available)
================================================================================

[DAS]domain1.suok>application-info -id myApp -server server1 -detail -module ejb -bean HelloBean
bean HelloBean
Application name : myApp
Module name : ejb
Bean name: HelloBean
================================================================================
+---------------+-----------+-------------------+--------------+---------------+
|      Name     |  (Count)  | WaterMark(High:Low| Bound(Upper:L| Time(Max:Min:T|
|               |           |       :Cur)       |    ower)     |     otal)     |
+---------------+-----------+-------------------+--------------+---------------+
| create        | times(0)  |                   |              |               |
+---------------+-----------+-------------------+--------------+---------------+
| remove        | times(0)  |                   |              |               |
+---------------+-----------+-------------------+--------------+---------------+
| timed-rb      | transactio|                   |              |               |
|               |n(0)       |                   |              |               |
+---------------+-----------+-------------------+--------------+---------------+
| request       | request(0)|                   |              |               |
+---------------+-----------+-------------------+--------------+---------------+
| active-bean   |           | bean(0:0:0)       |              |               |
+---------------+-----------+-------------------+--------------+---------------+
| rolledback    | transactio|                   |              |               |
|               |n(0)       |                   |              |               |
+---------------+-----------+-------------------+--------------+---------------+
| total-bean    |           | bean(0:0:0)       |              |               |
+---------------+-----------+-------------------+--------------+---------------+
| comitted      | transactio|                   |              |               |
|               |n(0)       |                   |              |               |
+---------------+-----------+-------------------+--------------+---------------+
| MethodReadyCou|           | bean(0:0:0)       |              |               |
|nt             |           |                   |              |               |
+---------------+-----------+-------------------+--------------+---------------+
| active-thread |           | thread(0:0:0)     |              |               |
+---------------+-----------+-------------------+--------------+---------------+
| total-remote-t|           |thread(100:100:100)|              |               |
|hread          |           |                   |              |               |
+---------------+-----------+-------------------+--------------+---------------+
================================================================================

Running the application-info command displays the following information about all the applications in a domain:

ItemDescription
Application IDApplication ID. This value must be unique in a domain.
Application Type

Application type. This value is one of the following:

  • EAR: Application

  • EJB: EJB module

  • WAR: Web application module

  • RAR: Resource adapter module

  • CAR: Application client module

state

Status of an application in a domain. The value is one of the following:

  • INSTALLED

  • DISTRIBUTED

  • RUNNING

  • DEPLOYED

For detailed information about each state, see "1.1.3. Application Status".

Server TargetTarget server where the applications are deployed.
Cluster TargetTarget cluster where the applications are deployed.
Application PathPath where the applications are installed and managed.

An application in the exploded module format can be deployed to MSs on other machines by compressing the file. This is called a staging mode deployment. To deploy, place the application file in an application repository, or specify an absolute path to the file on the machine where DAS resides. For detailed information about deployment in staging mode, see "1.7. Deployment Staging Mode".

Using WebAdmin

The following is the process of deploying an application by specifying a path using WebAdmin:

Using a Console Tool

The following is the process of deploying an application in the Staging mode using the console tool:


A deployment plan is an external configuration file of an application that can be used to modify the application DD at the time of deployment.

JEUS defines deployment plan in XML format, and it can be applied to an EJB, web application, EAR standard DD, and JEUS DD. When deploying applications, if you specify to use a deployment plan, the deployment plan configurations and DD will be merged at deployment time to determine the final application configuration settings before starting deployment.

This section describes about deployment plan configurations and operation methods. This section also describes how to deploy applications using a deployment plan through the WebAdmin or console tool.

This section describes how to configure a deployment plan and its operation methods through an example.

Deployment Plan Configurations

The following example shows how to implement a deployment plan:

<?xml version="1.0" encoding="UTF-8"?>
<jeus-deployment-plan xmlns="http://www.tmaxsoft.com/xml/ns/jeus"
                      xmlns:jeus="http://www.tmaxsoft.com/xml/ns/jeus"
                      xmlns:javaee="http://java.sun.com/xml/ns/javaee"
                      xmlns:j2ee="http://java.sun.com/xml/ns/j2ee">
    <descriptors>
        <!-- For standalone EJB -->
        <descriptor>
            <uri>META-INF/ejb-jar.xml</uri>
            <configurations>
                <configuration>
                    <action>REPLACE</action>
                    <xpath>//j2ee:ejb-name[.='ByeBean']</xpath>
                    <value>
                        <![CDATA[<ejb-name>HiBean</ejb-name>]]>
                    </value>
                </configuration>
                <configuration>
                    <action>DELETE</action>
                    <xpath>/child::j2ee:ejb-jar/child::j2ee:enterprise-beans/
child::j2ee:session/child::j2ee:local-home[.='HelloHomeLocal']</xpath>
                </configuration>
                <configuration>
                    <action>APPEND_CHILD</action>
                    <xpath>/child::j2ee:ejb-jar/descendant::j2ee:session[2]</xpath>
                    <value>
                        <![CDATA[<transaction-type>Bean</transaction-type>]]>
                    </value>
                </configuration>
                <configuration>
                    <action>INSERT_BEFORE</action>
                    <xpath>/j2ee:ejb-jar/j2ee:enterprise-beans/j2ee:session/
j2ee:ejb-name[.='HelloBean']/../j2ee:transaction-type</xpath>
                    <value>    
                        <![CDATA[<session-type>Stateless</session-type>]]>
                    </value>
                </configuration>
            </configurations>
        </descriptor>
        <descriptor>
            <uri>META-INF/jeus-ejb-dd.xml</uri>
            <configurations>
                <configuration>
                    <action>REPLACE</action>
                    <xpath>/jeus:jeus-ejb-dd/jeus:beanlist/jeus:jeus-bean/
jeus:export-name[.='ByeBean']</xpath>
                    <value>
                        <![CDATA[<export-name>HiBean</export-name>]]>
                    </value>
                </configuration>
                <configuration>
                    <action>DELETE</action>
                    <xpath>/jeus:jeus-ejb-dd/jeus:beanlist/jeus:jeus-bean/
jeus:local-export-name[.='HelloBeanLocal']</xpath>
                </configuration>
                <configuration>
                    <action>APPEND_CHILD</action>
                    <xpath>/jeus:jeus-ejb-dd/jeus:beanlist/jeus:jeus-bean</xpath>
                    <value>
                        <![CDATA[<jeus-rmi>false</jeus-rmi>]]>
                    </value>
                </configuration>
                <configuration>
                    <action>INSERT_BEFORE</action>
                    <xpath>/jeus:jeus-ejb-dd/jeus:beanlist/jeus:jeus-bean/
jeus:ejb-name[.='HiBean']/../jeus:jeus-rmi</xpath>
                    <value>
                        <![CDATA[<thread-max>100</thread-max>]]>
                    </value>
                </configuration>
            </configurations>
        </descriptor>
        <!-- For standalone web application -->
        <descriptor>
            <uri>WEB-INF/web.xml</uri>
            <configurations>
                <configuration>
                    <action>REPLACE</action>
                    <xpath>/child::javaee:web-app/child::javaee:servlet-mapping/
child::javaee:servlet-name[.='HiServlet']</xpath>
                    <value>
                        <![CDATA[<servlet-name>HelloServlet</servlet-name>]]>
                    </value>
                </configuration>
                <configuration>
                    <action>DELETE</action>
                    <xpath>//javaee:load-on-startup</xpath>
                </configuration>
                <configuration>
                    <action>APPEND_CHILD</action>
                    <xpath>/javaee:web-app/descendant::javaee:login-config</xpath>
                    <value>
                        <![CDATA[<auth-method>BASIC</auth-method>]]>
                    </value>
                </configuration>
                <configuration>
                    <action>INSERT_BEFORE</action>
                    <xpath>/javaee:web-app/javaee:env-entry/
javaee:env-entry-value[.='value1']</xpath>
                    <value>
                        <![CDATA[<env-entry-type>java.lang.String</env-entry-type>]]>
                    </value>
                </configuration>
            </configurations>
        </descriptor>
        <descriptor>
            <uri>WEB-INF/jeus-web-dd.xml</uri>
            <configurations>
                <configuration>
                    <action>REPLACE</action>
                    <xpath>//jeus:enable-jsp</xpath>
                    <value>
                        <![CDATA[<enable-jsp>true</enable-jsp>]]>
                    </value>
                </configuration>
                <configuration>
                    <action>DELETE</action>
                    <xpath>/jeus:jeus-web-dd/child::jeus:max-instance-pool-size</xpath>
                </configuration>
                <configuration>
                    <action>INSERT_BEFORE</action>
                    <xpath>/jeus:jeus-web-dd/descendant::jeus:enable-jsp</xpath>
                    <value>
                        <![CDATA[<context-path>/hello</context-path>]]>
                    </value>
                </configuration>
                <configuration>
                    <action>APPEND_CHILD</action>
                    <xpath>//jeus:jeus-web-dd</xpath>
                    <value>
                        <![CDATA[<webinf-first>false</webinf-first>]]>
                    </value>
                </configuration>
            </configurations>
        </descriptor>
        <!-- For EAR -->
        <descriptor>
            <uri>META-INF/application.xml</uri>
            <configurations>
                <configuration>
                    <action>REPLACE</action>
                    <xpath>/javaee:application/javaee:library-directory</xpath>
                    <value>
                        <![CDATA[<library-directory>mylib</library-directory>]]>
                    </value>
                </configuration>
            </configurations>
        </descriptor>
        <descriptor>
            <uri>ejb.jar/META-INF/ejb-jar.xml</uri>
            <configurations>
                <configuration>
                    <action>REPLACE</action>
                    <xpath>/javaee:ejb-jar/javaee:enterprise-beans/
javaee:session/javaee:ejb-class</xpath>
                    <value>
                        <![CDATA[<ejb-class>HelloBean</ejb-class>]]>
                    </value>
                </configuration>
            </configurations>
        </descriptor>
            <descriptor>
            <uri>web.war/WEB-INF/web.xml</uri>
            <configurations>
                <configuration>
                    <action>REPLACE</action>
                    <xpath>/javaee:web-app/javaee:servlet-mapping/
javaee:servlet-name</xpath>
                    <value>
                        <![CDATA[<servlet-name>HelloServlet</servlet-name>]]>
                    </value>
                </configuration>
            </configurations>
        </descriptor>
    </descriptors>
</jeus-deployment-plan>      

The following describes the child tags of <descriptor>:

Deployment Plan Operation Methods

This section describes deployment plan operations by tags, based on the previous example.

  • <descriptor>

    A deployment plan consists of multiple <descriptor> tags. Use the <uri> tag to specify the target DD, which becomes a target in units of <descriptor> tag. Using the application file as the root, specify <uri> value as a relative path to DD to determine the target DD.

    • For example, the standard DD of a standalone EJB module is always placed in META-INF/ejb-jar.xml and JEUS DD in META-INF/jeus-ejb-dd.xml from the application root. Therefore the first <descriptor> tag of the previous deployment plan is for the standard DD of a standalone EJB module obtained from the <uri> value. The second <descriptor> tag is for JEUS DD of a standalone EJB module obtained from the <uri> value. The same rule applies to standalone web applications or EAR.

    • If the <uri> value is 'ejb.jar/META-INF/ejb-jar.xml', the <descriptor> value is an EJB module (file name is ejb.jar), which belongs to EAR. If the <uri> value is 'web.war/WEB-INF/web.xml', the <descriptor> value is a WEB module (file name is web.war), which belongs to EAR.

    • One deployment plan can be used to deploy various applications. Only the <descriptor>'s, which match the <uri> value of application DD, are selected for deployment. Thus, other <descriptor>'s have absolutely no effect on deployment.

  • <configuration>

    The following example uses the first <descriptor> configuration to describe how DD is changed according to the <descriptor> configuration.

    • As explained earlier, the first <descriptor> tag configures the standard DD of a standalone EJB module. The first action performed is replacing a specific tag and is expressed in the first <configuration> tag. It shows that the <ejb-name> tag with the value, 'ByeBean', is replaced with the <ejb-name> tag with the value, 'HiBean'.

    • The second <configuration> expresses the action of deleting a <local-home> tag with the value, 'HelloHomeLocal'.

    • The third <configuration> expresses the action of adding a <transaction> tag as the last child of the second <session> tag.

    • The fourth <configuration> expresses the action of adding a <session-type> tag as a previous sibling of a <session> tag, whose <ejb-name> tag value is 'HelloBean'.

You can check the installed deployment plan by using WebAdmin or a console tool. Each deployment plan is distinguished by the deployment plan identifier that is assigned during the installation. You can also display the list of applications by deployment plan that is applied to the application, as well as the actual deployment file content.

Using WebAdmin

The following is the process of checking for the installed deployment plan using WebAdmin:

  1. To view the Deployed Application screen, select [Applications] from the left menu in WebAdmin. If [plan] is clicked, the Deployment Plan screen will appear.

  2. The deployment plan list is displayed on the Deployment Plan screen as follows:

  3. If a specific deployment plan name is selected from the list, its details are displayed.

Using Console Tool

By using the deployment-plan-info command in the console tool, you can obtain the list of applications, to which deployment plans which are installed on a domain applies to. If a particular deployment plan is selected, its details are displayed.

  • Checking Deployment Plan List

    [DAS]domain1.adminServer>dpinfo
    The list of deployment plans installed in the domain and the applications to which each deployment plan applies
    ===========================================================
    +------------------------------------------+--------------+
    |              Deployment plan             | Applications |
    +------------------------------------------+--------------+
    | plan1                                    |              |
    +------------------------------------------+--------------+
    ===========================================================
  • Checking Deployment Plan Details

    [DAS]domain1.adminServer>dpinfo -name plan1
    <?xml version="1.0" encoding="UTF-8"?>
    <jeus-deployment-plan xmlns="http://www.tmaxsoft.com/xml/ns/jeus">
       ...
    </jeus-deployment-plan>

You can verify the deployment plan that was applied to an application using the WebAdmin or console tool.

Using WebAdmin

The following is the process of verifying the deployment plan, which was applied to an application, using WebAdmin:

  1. To view the Deployed Application screen, select [Applications] from the left menu in WebAdmin. If an application ID is selected on the screen, the details will be displayed.

  2. Detailed information related to the application ID includes information about the applied deployment plan.

Using Console Tool

In the console tool, the deployment plan, which was applied to an application, can be checked by executing the application-info command.

[DAS]domain1.adminServer>appinfo -id webapp -detail
Application information for the domain [domain1].
================================================================================
+------+-------+-----+------+-------+--------------+----------+----------+-----+
| Appli| Applic|State|Server|Cluster|    Running   | Applicati| Applicati| Plan|
|cation| ation |     |Target|Targets|   Servers    | on Path  | on Time  |Name |
|  ID  | Type  |     |  s   |       |              |          |          |     |
+------+-------+-----+------+-------+--------------+----------+----------+-----+
|webapp| WAR   | RUNN| ALL  | ALL   | server1,serve| ${INSTALL| Tue May  |plan1|
|      |       |ING  |      |       |r2,server3,adm|_HOME}/web|28        |     |
|      |       |     |      |       |inServer      |app/deploy|22:45:13  |     |
|      |       |     |      |       |              |ment_plan_|KST 2013  |     |
|      |       |     |      |       |              |web.war   |          |     |
+------+-------+-----+------+-------+--------------+----------+----------+-----+
================================================================================