30 April 2009

WLS and JConsole

Here's a script I used to connect JConsole to a WLS 10.3.x instance.

Thanks to James Bayer for his blog on this too.

@setlocal

rem runtime_url=service:jmx:rmi:///jndi/iiop://localhost:7001/weblogic.management.mbeanservers.runtime
set domain_url=service:jmx:rmi:///jndi/iiop://localhost:7001/weblogic.management.mbeanservers.domainruntime

set JAVA_HOME=d:\bea\jrockit_160_05_R27.6.2-20
set WLS_HOME=d:\bea\wlserver_10.3\server

set JCONSOLE_CLASSPATH
set JCONSOLE_CLASSPATH=%JCONSOLE_CLASSPATH%;%JAVA_HOME%\lib\jconsole.jar
set JCONSOLE_CLASSPATH=%JCONSOLE_CLASSPATH%;%JAVA_HOME%\lib\tools.jar

set WLS_CLASSPATH=
set WLS_CLASSPATH=%WLS_CLASSPATH%;%WLS_HOME%\lib\wljmxclient.jar
set CLASSPATH=%JCONSOLE_CLASSPATH%;%WLS_CLASSPATH%

set PROPS=
set PROPS=%PROPS% -J-Djmx.remote.proto.provider.pkgs=weblogic.management.remote
set PROPS=%PROPS% -J-Djava.class.path=%CLASSPATH%

jconsole %PROPS%

@endlocal



2 comments:

Anonymous said...

i am NOT able to get it working..

Buttso said...

OK. This script is merely a guide that I used successfully to do this -- you'll need to adapt it to your local environment.