from java.lang import Exception as JavaException
myapps=AdminApp.list().splitlines()
for app in myapps:
x=AdminControl.queryNames('type=Application,name='+app+',*')
if (len(x) == 0):
print app 'Application is not started'
mycell=AdminControl.getCell()
mynode=AdminControl.getNode()
mserver=AdminControl.queryNames('node='+mynode+',type=Server,*')
myserver=AdminControl.getAttribute(mserver,'name')
appManager = AdminControl.queryNames('type=ApplicationManager,cell='+mycell+',node='+mynode+',process='+myserver+',*')
try:
AdminControl.invoke(appManager,'startApplication',app)
except JavaException,target:
"WSADMIN EXCEPTION",target
Place these lines in jython file named appstatus.py and execute wsadmin using the below option:
Go to $WAS_PROFILE/bin and issue the below command
./wsadmin.sh -lang jython -f appstatus.py
Helpful, thank you.
ReplyDeleteOne small mistake though (I think).
Shouldn't the line
mynode=AdminControl.getCell()
not read
mynode=AdminControl.getNode() ???
Thanks for pointing the spelling mistake.Its corrected now.
ReplyDeleteThanks :) its usefull
ReplyDelete