ce97
作者ce97·2015-03-31 18:23
软件开发工程师·某某某

通过wsadmin启动websphere中的一个应用程序

字数 1554阅读 3653评论 0赞 1

系统环境为RHEL6.4,WAS版本为8.0.0.5
目的:命令行启动一个应用程序。
1.到was安装目录
[root@oracle11g ~]# cd /opt/IBM/WebSphere/AppServer/bin/

2.执行wsadmin命令
[root@oracle11g bin]# ./wsadmin.sh -lang jython -user wasadmin -password wwwwww
WASX7209I: Connected to process "dmgr" on node oracle11gCellManager01 using SOAP connector;  The type of process is: DeploymentManager
WASX7031I: For help, enter: "print Help.help()"

3.设置Cell、Node、Server信息,此信息可以从WebSphere控制台->应用程序->应用程序类型->WebSphere企业应用程序->Hello_war->管理模块->集群与服务器,可以查看此应用对应的Cell、Node、Server信息。
wsadmin>appManager = AdminControl.queryNames('cell=oracle11gCell01,node=oracle11gNode01,type=ApplicationManager,process=server1,*')
wsadmin>print appManager
WebSphere:name=ApplicationManager,process=server1,platform=proxy,node=oracle11gNode01,version=8.0.0.5,type=ApplicationManager,mbeanIdentifier=ApplicationManager,cell=oracle11gCell01,spec=1.0

4.启动Hello_war这个应用
wsadmin>AdminControl.invoke(appManager, 'startApplication', 'Hello_war')
''
5.此时可以到控制台查看Hello_war这个应用是否启动,

6.或者使用命令行再次启动,如果应用是处于启动状态,则会返回如下所示
wsadmin>AdminControl.invoke(appManager, 'startApplication', 'Hello_war')
WASX7015E: Exception running command: "AdminControl.invoke(appManager, 'startApplication', 'Hello_war')"; exception information:
 javax.management.MBeanException
com.ibm.ws.exception.RedundantStateChangeException: Composition Unit WebSphere:cuname=Hello_war,cuedition=BASE already started

7.官档连接
http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.0.0/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/txml_startapplication.html?lang=en

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

1

添加新评论0 条评论

Ctrl+Enter 发表

作者其他文章

相关文章

相关问题

相关资料

X社区推广