JMX (remote)

wlshell provides a connector to access to Remote JMX Agents. It supports JMX 1.2 with JMX Remote API 1.0. Some implementations of these specifications are J2SE 5.0 and MX4J.

The protocol in the URL to use the Remote JMX Connector is "service:jmx:rmi".

Creating New MBeans

Objects implemented as MBeans can be registered with the Remote JMX Agent (MBean Server) using the mkdir command. The method is the same as the Local JMX Agent.

Sun J2SE 5.0 JMX

Server Configuration

The JMX technology is included with Sun's J2SE 5.0 as documented here.

The Remote JMX Agent can be enabled by starting the JVM with the following properties:

-Dcom.sun.management.jmxremote.port=1090
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
The port can be any arbitrary available one.

More information can be found in the following articles:

Connecting from wlshell

Once the Remote JMX Agent is configured and running, the following URL can be used with the wlshell connect command:

connect service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi
The server name (localhost) and listen port (1090) should be changed to the actual values.

wlshell should be started using J2SE 5.0 and the JMX environment. See the installation section for more information.

Example

In the following example, we will start a Java application with the Remote JMX Agent enabled and connect from wlshell. The example is for the Windows platform.

set JAVA_HOME=c:\jkd1.5.0
cd %JAVA_HOME%
bin\java -Dcom.sun.management.jmxremote.port=1090
           -Dcom.sun.management.jmxremote.authenticate=false
           -Dcom.sun.management.jmxremote.ssl=false -jar demo\jfc\Java2D\Java2Demo.jar
In another command window, start wlshell and connect to the Remote JMX Agent. wlshell is configured to use Sun J2SE 5.0 JMX (with file "env4jmx.cmd"):
set WLSHELL_HOME=c:\wlshell-2.1.0
cd %WLSHELL_HOME%\bin
wlsh

wlsh [not connected]> connect service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi
connecting to MBeanServer(s) as weblogic...done

type "info" for connection information

wlsh JMImplementation:/> domains
[JMImplementation, java.lang, java.util.logging]

wlsh JMImplementation:/> explore