Wednesday, May 9, 2012

Monitoring Weblogic remotely using JMX

It has been a while since I had to use Weblogic for deployment. Furthermore, I wanted to monitor my application using MBeans. As I tried to do this, I encountered many problems (e.g. unknown host name,  ClassNotFoundException, ssh problems, etc). These are my notes about what I had in front of me and how I solved them.


First, the Weblogic instance was in a server with a number of firewall policies. This means that I had to use remoting over to an acceptable port (weblogic's non ssl port is fine). In addition, I kept on getting a ClassNotFoundException as described below:
WARNING: "IOP00810257: (MARSHAL) Could not find class"
These made me look on the internet and here is what I did:
  1. Ensure that Weblogic is started with the following flag: -Dcom.sun.management.jmxremote. This is actually important if you care to see things other than MBeans (e.g. memory management, etc).
  2. On the client side, running JConsole (or VisualVM), ensure that wljmxclient.jar is in your classpath.
After following these two steps, connect to the weblogic MBean server of choice:
  • weblogic.management.mbeanservers.domainruntime
  • weblogic.management.mbeanservers.runtime
  • weblogic.management.mbeanservers.edit
So your remote connection will look something like (for the runtime mbean server):

service:jmx:rmi:///jndi/iiop://:/weblogic.management.mbeanservers.runtime

After setting this, I added it to my ant script to help me start jconsole directly to Weblogic. I'm happier than earlier today.

1 comment:

Steve Aubrey said...

Thanks, Alberto. It was making sure that wljmxclient.jar was on the classpath that pushed me up and over the top.

And I'm happier now, too!

Steve