最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - weblogic undeploy apps command line - Stack Overflow

programmeradmin2浏览0评论

I have a requirement where i need to undeploy war files in weblogic using mand line, the below code does it for me :

 java weblogic.Deployer -adminurl t3://localhost:8001 -user weblogic -password password123  -name <name> -undeploy 

But the file names change after every deployment, i,e (file 1.0.0 and file 1.1.1).

i need a mand in such a way so that it undeploys all the files present in that server.

can any body let me know how to undeploy all files at a single go ?

Thanks in advance,

Vishal

I have a requirement where i need to undeploy war files in weblogic using mand line, the below code does it for me :

 java weblogic.Deployer -adminurl t3://localhost:8001 -user weblogic -password password123  -name <name> -undeploy 

But the file names change after every deployment, i,e (file 1.0.0 and file 1.1.1).

i need a mand in such a way so that it undeploys all the files present in that server.

can any body let me know how to undeploy all files at a single go ?

Thanks in advance,

Vishal

Share Improve this question asked Aug 3, 2014 at 16:28 user1190615user1190615 1111 gold badge4 silver badges17 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 2

I have found out how to undeploy all the apps :

List Apps:


import sys
connect('weblogic','weblogic10','http://autowfm-vmh:7259')
cd("AppDeployments")
app = ls(returnMap='true')
domainRuntime()
cd("AppRuntimeStateRuntime/AppRuntimeStateRuntime")

i=1
f = open('filename.txt','w')
for appName in app:

print >>f, appName

i=i+1
f.close()
exit()

Undeploy :

import os
connect('weblogic','weblogic','http://localhost:7001')
target='AdminServer' 
f = open(r'D:\filename.txt','r') 
print f 

for i in range(10): 
line=f.readline() 
line1=line[:-1] 
appName='./'+line1 
print '*****************'+appName 

undeploy(appName=line1)
exit()

If you want to script a more generic answer you can list all the apps via:

java -cp /opt/ora/mw/wlserver_10.3/server/lib/weblogic.jar weblogic.Deployer 
-adminurl t3://host:port  -username weblogic -password  weblogic1 -listapps

And then parse that output to begin removing apps.

The <name> should be the module name not the file (war or ear) name. Using the -undeploymand without the -targets and -submoduletargets flags pletely removes the application or standalone module from all WebLogic Server instances and untargets all JMS sub-module resources. BTW, Adding the -graceful option would allow current HTTP clients to plete their work before undeploying. Note: Undeploying a deployment unit does not remove the original source files used for deployment. It only removes the deployment's configuration from the domain, as well as any deployment files that WebLogic Server created during deployment (for example, files copied with stage deployment mode and files uploaded to the Administration Server).

I have found out how to undeploy all the apps without using files

def undeployWars():
    cd("AppDeployments")
    namesWars = ls(returnMap='true')
    for nameWar in namesWars:
        undeploy(nameWar)


connect('weblogic', 'weblogic01', 't3://localhost:7001')
undeployWars()
disconnect()
exit()
发布评论

评论列表(0)

  1. 暂无评论