Bootstrap FreeKB - IBM WebSphere - Deploy application using monitoredDeployableApps directory (properties file)
IBM WebSphere - Deploy application using monitoredDeployableApps directory (properties file)

Updated:   |  IBM WebSphere articles

There are various ways to deploy an application to a WebSphere Application Server (JVM).

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.


Create the properties file

If possible, it is much easier to install the application using the WebSphere admin console, and to then use wsadmin to create the properties file. You would run this wsadmin command on the dmgr. This will create a file named example.props. The example.props file can then be used for subsequent deploys.

${WAS_INSTALL_ROOT}/profiles/your_dmgr_profile/bin/wsadmin.sh -lang jython -c "print AdminTask.extractConfigProperties('[-propertiesFileName example.props -configData Deployment=your_app -options [[SimpleOutputFormat true]]]')"

 


Add a properties file to the deploymentProperties directory

Following is an example properties file. If you are deploying a WAR, you will still use "EarFileLocation".

# HEADER
ResourceType=Application
ImplementingResourceType=Application

# PROPERTIES
Name=myApp
TargetServer=your_server_hostname
TargetNode=your_server_nodename
EarFileLocation=/path/to/example.ear
TargetCluster=your_cluster # Only needed if using cluster

# ENVIRONMENT VARIABLES
cellName=your_cellname
nodeName=your_nodename
serverName=your_server_hostname

 

You will simply add the properties file to the ${WAS_INSTALL_ROOT}/profiles/your_profile/monitoredDeployableApps/deploymentProperties/ directory and the app should be automatically deployed.

You can now check if the application was successfully deployed.

 


Virtual Host

Use the following to map your app to virtual host default_host. You would only change "your_app" to the name of your app.

ResourceType=Application
ImplementingResourceType=Application
ResourceId=Deployment=!{applicationName}
taskName=MapWebModToVH
row0={webModule uri virtualHost}
mutables={false false true}
row1={"your_app" your_app.war,WEB-INF/web.xml default_host}

 


Automatic undeploy

Adding DELETE=true as the first line in the properties section of the properties file will undeploy the app. Here is an example of the undeploy from a properties file.

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

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


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