This post originated from an RSS feed registered with Java Buzz
by Vinny Carpenter.
Original Post: WebLogic and JMX
Feed Title: Vinny Carpenter's Blog
Feed URL: http://www.j2eegeek.com/error.html
Feed Description: Welcome to my blog. I am a total Java geek that lives in Milwaukee, making my living as an architect/developer, spending all my time with Java, J2EE, OO, Linux, and open source. In my spare time, when I am not in front of my computers, I spend every other minute with my other loves: My wife, books, music, guitars, Formula-1 racing and StarGate. Check out my blog @ http://www.j2eegeek.com/blog
I know I rarely use JMX, the Java Management Extensions (JMX) 1.0 specification that provide open and extensible management services. But there are instances when it's a great thing to have in your tool-belt, specially dealing with applications deployed in a WebLogic cluster in a distributed environment. As users of WebLogic know, WebLogic Server has implemented JMX 1.0 and added its own set of convenience methods and other extensions to facilitate working in the WebLogic Server.
The WebLogic JMX services expose the management attributes and operations of managed resources through one or more managed beans (MBeans). An MBean is really a concrete Java class that is developed per JMX specifications that provides getters and setters for each attribute. For more information, check out the WebLogic documentation for Programming WebLogic Management Services with JMX.
My usage of JMX is fairly limited and it's usually something simple like discovering all the names and addresses of managed servers in a cluster. For redundancy and fault tolerance, I will create caches of data at the individual server level (No, we don't use Coherence :)) that need to be managed across the cluster. My typical pattern is to create a simple admin servlet that sits in each member of the cluster and interacts with the cache via the exposed destroy, reset, display, etc operations. Here's a snippet of code that allows you to discover members of a WebLogic cluster:
//getting the names of servers in the domain System.out.println("Active Servers: "); Set mbeanSet = home.getMBeansByType("ServerRuntime"); Iterator mbeanIterator = mbeanSet.iterator();
while (mbeanIterator.hasNext()) { ServerRuntimeMBean serverRuntime = (ServerRuntimeMBean) mbeanIterator.next();
if (serverRuntime.getState().equals(ServerStates.RUNNING)) {
Has anybody tried managing weblogic remotely without using any of the weblogic specific jar files. I tried using RMI/IIOP instead of t3 and no weblogic.jar/wlclient.jar files in my runtime classpath. I am able to get the stub but get a CORBA.MARSHAL exception on MBeanServer.queryNames method. Is there anything I am missing. Has anyone faced this problem. Please let me know if you know a solution to this.