系统环境为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.官档连接
阅读(6532) | 评论(0) | 转发(0) |