Oracle® Fusion Middleware Developing Manageable Applications With JMX for Oracle WebLogic Server 11g Release 1 (10.3.6) Part Number E13729-05 |
|
|
PDF · Mobi · ePub |
Besides programmatic JMX access to your custom MBeans, you can use any JMX-compliant management system to access your MBeans. For information, see the Oracle Technology Network Web site, which provides links to books, white papers, and other information on JMX: http://www.oracle.com/technetwork/java/javase/tech/javamanagement-140525.html
.
The following sections describe additional ways to access your custom MBeans:
The JDK includes JConsole, a Swing-based JMX client that you can use to browse MBeans. You can browse the MBeans in any WebLogic Server MBean server and in the JVM platform MBean server. Oracle recommends that you use JConsole only in a development environment; it consumes significant amounts of resources. See Using JConsole to Monitor Applications at http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html
.
To access custom MBeans from JConsole:
If wljmxclient.jar
and wlclient.jar
are not in the JConsole classpath:
Enable the IIOP protocol for the WebLogic Server instance that hosts your MBeans.
Configure the default IIOP user to be a WebLogic Server user with Administrator privileges. In this scenario, the login and password you provide in Step 5d or Step 6d is irrelevant, and the default IIOP user will be associated with each request.
See "Enable and Configure IIOP" in Administration Console Online Help.
If wljmxclient.jar
and wlclient.jar
are in the JConsole classpath, there is no need to enable the default IIOP user. Go to Step 2.
Notes:
wlclient.jar
is included in wljmxclient.jar
's MANIFEST ClassPath entry, so wlclient.jar
and wljmxclient.jar
need to be in the same directory, or both jars need to be specified on the classpath.
Ensure that weblogic.jar
or wlfullclient.jar
is not included in the classpath if wljmxclient.jar
is included. Only the thin client wljmxclient.jar
/wlclient.jar
or the thick client wlfullclient.jar
should be used, but not a combination of both.
From a command prompt, make sure that JDK 6 or its equivalent is on the path.
At the command prompt, enter the following command:
jconsole -J-Djava.class.path=$JAVA_HOME/lib/jconsole.jar:$JAVA_HOME/ lib/tools.jar:$WLS_HOME/lib/wljmxclient.jar -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote
Note:
If your configuration is as described in Step 4, you can start JConsole simply by executing the commandjconsole
. If you start JConsole this way, however, only the user who started the WLS process will be able to connect locally.If your custom MBeans are registered in the JVM platform MBean server (or if you have configured the WebLogic Server Runtime MBean Server to be the JVM platform MBean server):
In the JConsole window, select Connection > New Connection.
In the New Connection window, select the Local Process tab, select the WebLogic.Server, and click Connect.
If your custom MBeans are registered in the WebLogic Server Runtime MBean Server, and if you have not configured the Runtime MBean Server to be the platform MBean server:
In the JConsole window, select Connection > New Connection.
In the New Connection window, select the Remote Process option.
In the Remote Process JMX URL text box, enter:
service:jmx:rmi:///jndi/iiop://host:port/weblogic.management.mbeanservers.runtime
where host:port
is the host name and port of the WebLogic Server instance that hosts your MBeans.
For example:
service:jmx:rmi:///jndi/iiop://localhost:7001/weblogic.management.mbeanservers.runtime
In the User Name and Password fields, enter the user name and password of any user account that is assigned the admin role. This login will be used to authenticate the client and create the Subject that will be associated with each JMX request coming from the client.
Click Connect.
If your custom MBeans are registered in the WebLogic Server Domain Runtime MBean Server:
In the Console window, select Connection > New Connection.
In the New Connection window, select the Remote Process option.
In the Remote Process JMX URL text box, enter:
service:jmx:rmi:///jndi/iiop://host:port/weblogic.management.mbeanservers.domainRuntime
where host:port
is the host name and port of the Administration Server.
For example:
service:jmx:rmi///jndi/iiop://localhost:9002/weblogic.management.mbeanservers.domainRuntime
In the User Name and Password fields, enter the user name and password of any user account that is assigned the admin role. This login will be used to authenticate the client and create the Subject that will be associated with each JMX request coming from the client.
Click Connect.
If you register your MBeans in the Runtime MBean Server or Domain Runtime MBean Server, you can use WebLogic Scripting Tool to access your custom MBeans. See "Accessing Other WebLogic MBeans and Custom MBeans" in Oracle WebLogic Scripting Tool.
You can extend the WebLogic Server Administration Console by creating Java Server Pages (JSPs) that conform to a specific template. Your JSP can include JMX code that connects to the JVM platform MBean server, the WebLogic Server Runtime MBean Server, or the Domain Runtime MBean Server and looks up your MBeans.
For more information, see Extending the Administration Console for Oracle WebLogic Server.