- Given weblogic application server.
- Undeploy/remove application from weblogic admin server using WLST (WebLogic Scripting Tool).
- We will execute deployment script from wlst console (oracle_common/common/bin/wlst.sh)
1. Steps required to remove/undeploy application from weblogic admin server:
- Connect to admin server using admin server credentials.
- Start edit operation to deploy application.
- Undeploy/remove/delete application from weblogic admin server
- Save and activate session.
- Disconnect from admin server.
2. WLST Script to remove/undeploy application from weblogic server:
def wlUnDeploy(username, password, adminURL, appName):
#connect to admin server
connect(username, password, adminURL)
#start edit operation
#start deploying application to admin server
progress = undeploy(appName, timeout=60000)
#disconnect from Admin server
except Exception, ex:
#wlUnDeploy("<Admin User Name>","<Password>","<AdminUrl","<App Name>")
3. Output: undeploy/remove application from weblogic server
Connecting to t3://myweblogic_server:7001 with userid weblogic ...
Successfully connected to Admin Server "AdminServer" that belongs to domain "cluster".
Warning: An insecure protocol was used to connect to the server.
To ensure on-the-wire security, the SSL port or Admin port should be used instead.
Location changed to edit tree.
This is a writable tree with DomainMBean as the root.
To make changes you will need to start an edit session via startEdit().
For more help, use help('edit').
You already have an edit session in progress and hence WLST will
continue with your edit session.
Starting an edit session ...
Started edit session, be sure to save and activate your changes once you are done.
Stopping application myAppName.
You have an edit session in progress, hence WLST will not block for your stopApplication to complete.
Stopped the Application. Please refer to the returned WLSTProgress object or variable LAST to track the status.
Undeploying application myAppName ...
You have an edit session in progress, hence WLST will not block for your undeployment to complete.
Started the undeployment of Application. Please refer to the returned WLSTProgress object or variable LAST to track the status.
Current Status of your Deployment:
Deployment command type: undeploy
Deployment State : running
Deployment Message : [Deployer:149140]The task cannot be processed further until the current edit session is activated. When this occurs, task processing will continue. The user can exit the deployer tool without affecting the task.
Saving all your changes ...
Saved all your changes successfully.
Activating all your changes, this may take a while ...
The edit lock associated with this edit session is released once the activation is completed.
Disconnected from weblogic server: AdminServer