How to stop/start specfic WebSphere-deployed EAR from command line?

user1561108 picture user1561108 · May 22, 2013 · Viewed 15.8k times · Source

I'm throwing a dependency jar into my exploded EAR on WebSphere app server. I need to stop/start the EAR to get WS to execute the new code. Is there a way to do this from command line?

Answer

trikelef picture trikelef · May 22, 2013

Try running something like this:

/opt/ibm/websphere/appserver/profiles/<MyProfileName>/bin/wsadmin.sh -c "AdminControl.invoke(AdminControl.queryNames('type=ApplicationManager,process=<MyServerName>,*'),'stopApplication','MyAppName')" -lang jython

It will prompt you for a WAS Userid and password (in case you have enabled "Administrative Security") and when you enter them - provided your userid has at least been assigned the Operator Role - your application will be stopped.

In a similar way you may start the same application.