如何从命令行停止/启动特定于WebSphere部署的EAR?
问题描述:
我正在将依赖项jar放入我在WebSphere app服务器上爆炸的EAR中.我需要停止/启动EAR以使WS执行新代码.有没有办法从命令行执行此操作?
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?
答
尝试运行类似这样的内容:
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
它会提示您输入WAS用户名和密码(如果您已启用了管理安全性" ),并且在输入时-前提是您的用户名至少已分配了操作员角色-您的应用程序将被停止.
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.