Create a text file, say installApplication.py
, and insert the two following lines:
AdminApp.install('<path_to_application>/application.ear','[-node nodeName -cell cellName -server serverName]')
AdminConfig.save()
Modify the values in the command according to your server, and save the file. [Note: The above commands are valid for a stand-alone environment].
Create a new file, say installApplication.bat
. Add the following command to invoke wsadmin using the above script file:
<path_to_WAS_profile>/bin/wsadmin.bat -lang jython -f <path_to_py_file>/installApplication.py
If administrative security is enabled, you will asked to authenticate when you run the command.
When uninstalling the application, the uninstallApplication.py
script looks like:
AdminApp.uninstall('<application_name>')
AdminConfig.save()
And then call it as:
<path_to_WAS_profile>/bin/wsadmin.bat -lang jython -f <path_to_py_file>/uninstallApplication.py
In a network deployment environment, you will likely be deploying your application to a cluster. The installApplication.py
script then contains the following code:
AdminApp.install('<path_to_application>/application.ear', '[-cluster cluster1]')
AdminConfig.save()
AdminNodeManagement.syncActiveNodes()
You can then call the wsadmin.bat
tool from the Deployment Manager profile folder.
The uninstallation commands remain the same between stand-alone and network deployment environments. Adding the line to synchronize the nodes, we have:
AdminApp.uninstall('<application_name>')
AdminConfig.save()
AdminNodeManagement.syncActiveNodes()