Posts categorized “weblogic”.

Monitor Weblogic through the command line

常用的几个weblogic.admin命令,监控weblogic的状态,首先要设置下weblogic的环境,运行/home/weblogic/bea/weblogic81/server/bin/setWLSEnv.sh,路径根据自己的weblogic安装不同作相应修改,配置自己的bash_profile,将运行上面脚本产生的PATH和CLASSPATH配置到bash_profile,至此weblogic和java环境配置完成了。

接下来是几个常用的监控weblogic状态的命令:

1、get state

>java weblogic.Admin -username user -password pass
GETSTATE myserver
Current state of "myserver" : RUNNING

2、get server config

> java weblogic.Admin -username user -password pass

GET -pretty -type Server

3、get server stats

> java weblogic.Admin -username user -password pass
GET -pretty
-type ServerRuntime

4、get queue stats

> java weblogic.Admin -username user -password pass

GET -pretty -type ExecuteQueueRuntime

5、get queue stats for just the default execute

queue (the one that does application work)

> java weblogic.Admin -username user -password pass
-pretty GET
 -mbean "mydomain:Location=myserver,
Name=weblogic.kernel.Default,
ServerRuntime=myserver,Type=ExecuteQueueRuntime"

6、get JVM stats

> java weblogic.Admin -username user -password pass

GET -pretty -type JVMRuntime

7、get JDBC stats

> java weblogic.Admin -username user -password pass
GET -pretty
-type JDBCConnectionPoolRuntime

weblogic error “BEA-149204″

如果启动weblogic时报错,错误代码149204,可能因为以下原因,解决办法如下
启动时的显示信息:

RegisterException due to underlying exception java.rmi.RemoteException: Failed to get message receiver on t3://localhost:7001; nested exception is:
java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused; No available router to destination
at weblogic.drs.internal.DataReplicationService.registerSlave
(DataReplicationService.java:285)
at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:370)
at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume
(DeploymentManagerServerLifeCycleImpl.java:229)
at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:136)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:965)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:360)
at weblogic.Server.main(Server.java:32)
>
****************************************************
The WebLogic Server did not start up properly.
Exception raised: ‘weblogic.management.DeploymentException: [Deployer:149204]The deployment framework was unable to register with the Data Replication Service.
RegisterException due to underlying exception java.rmi.RemoteException: Failed to get message receiver on t3://localhost:7001; nested exception is:
java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused; No available router to destination
at weblogic.drs.internal.DataReplicationService.registerSlave
(DataReplicationService.java:285)
at weblogic.management.deploy.slave.SlaveDeployer.resume
(SlaveDeployer.java:370)
at weblogic.management.deploy.
DeploymentManagerServerLifeCycleImpl.resume
(DeploymentManagerServerLifeCycleImpl.java:229)
at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:136)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:965)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:360)
at weblogic.Server.main(Server.java:32)

…………………………..#省略输出
解决方案:
#vi /etc/hosts
127.0.0.1 ****
看****是否为localhost,如果是其他内容则改成localhost即可。

还有启动错误容易发生:/home/weblogic/bea/config.xml not found的错误提示,解决办法是启动weblogic不要用绝对路径,而需要进到/home/weblogic/bea/user_projects/domains/wlgtest下,执行startWeblogic.sh