How to automatically deploy an application in WebSphere (monitoredDeployableApps ear war jar sar)

Home > Search > How-to
  by

There are two ways to go about automatically deploying an app.

  • Add an EAR, WAR, JAR, or SAR to the appropriate monitoredDeployableApps subdirectory
  • Add a properties file to the monitoredDeployableApps/deploymentProperties directory

This article describes how to deploy the app by placing an EAR, WAR, JAR, or SAR to the appropriate monitoredDeployableApps subdirectory. Refer to this article for the steps on how to deploy an app by placing a properties file to the monitoredDeployableApps/deploymentProperties directory.

A significant advantage to adding a properties file to the deploymentProperties directory is that you have more control at your disposal, such as being able to easily define the application name, mapping the application to a virtual host, and defining the context root of the application in the properties file.

By default, WebSphere is not setup to automatically deploy an app. Follow these steps to setup WebSphere to automatically deploy an app, which will also create the monitoredDeployableApps directory and subdirectories.


Add an EAR, WAR, JAR, or SAR to the appropriate monitoredDeployableApps subdirectory

Placing an EAR, WAR, JAR or SAR file in the subdirectory will automatically deploy the app to the server or cluster. The app should be in the was_home/profiles/your_profile/installedApps/ directory. The date and time listed should coorelate to the date and time that the app was deployed.

~]# ll was_home/profiles/your_profile/installedApps/
drwxrwxr-x 4 root root 4096 May 1 07:49 your_app_name.ear

 

The SystemOut.log can also be checked for assurance that the WAR or EAR was successfully deployed. 

CWLDD0014I: Event id 115306418-1. Installing application your_app_name...
ADMA5016I: Installation of your_app_name started.
ADMA5013I: Application your_app_name installed successfully.

 

There will also be an attempt to start the application.

ADMN1008I: An attempt is made to start the your_app_name application.
CWLDD0021I: Application your_app_name is started on: WebSphere:cell=cell01,node=node01,server=server01,status=success.
CWLDD0021I: Application your_app_name is started on: WebSphere:cell=cell01,node=node02,server=server02,status=success.

After the application has been deployed, the EAR WAR JAR or SAR file will be located at ${was_install_root}/profiles/dmgr_profile/config/cells/your_cell/applications on the dmgr. The EAR WAR JAR or SAR file will also be located at ${was_install_root}/profiles/node_profile/installedApps on each node server.

When an app is automatically deployed, the app may not be automatically mapped to a virtual host (such as default_host) and the modules (JVMs, web servers) may not be mapped to the application. Typically, in an Enterprise, a deployment tool such as Anthill or Jenkins will probably be used to manage the deployment. In a SOHO network, you want want to write a script (Bash Perl Python PowerShell) to run wsadmin commands to map the virtual host and modules after the app is deployed.

 


Automatic undeploy

Removing the EAR, WAR, JAR or SAR file will automatically undeploy the app. The SystemOut.log can be checked to ensure the app was undeployed.

CWLDD0007I: Event id 123456789. Start of processing. Event type: Deleted, File path: /path/to/example.properties

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments