File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes MBean not visible in Jconsole - Help needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "MBean not visible in Jconsole - Help needed" Watch "MBean not visible in Jconsole - Help needed" New topic
Author

MBean not visible in Jconsole - Help needed

Priyadarshan Kelkar
Ranch Hand

Joined: Apr 04, 2007
Posts: 31
I am running my webapp in Tomcat 6.0. I have declared a very simple MBean as follows:

package com.my.gtw;

import org.springframework.jmx.export.annotation.ManagedA ttribute;
import org.springframework.jmx.export.annotation.ManagedR esource;


@ManagedResource(objectName="bean:name=helloWorldJ MX",description="Hello World Managed Bean")
public class HelloWorldJMX {

private String message;

@ManagedAttribute(defaultValue="hello",description ="Message Attribute")
public String getMessage() {
return message;
}

public void setMessage(String message) {
this.message = message;
}

}


My app-config.xml is as follows:

<context:mbean-export />

<bean id="helloWorldMBean"
class="com.my.gtw.HelloWorldJMX"/>

When I run jconsole I do not see my MBean in the MBeans window.
Please help me .... seems to be a slip in configuration from my side.

Thanks in advance.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Stupid question here, but you are having JConsole connect to the correct Process ID PID for your running Tomcat where that app is deployed? Also under the mbeans tab, remember the name you use in @ManagedResource. To there would be a menu option on the left titled "bean" The last thing there threw me off the first time I went looking for my mbeans in JConsole.

Other questions are you sure that the app is deployed and running?

Thanks

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Priyadarshan Kelkar
Ranch Hand

Joined: Apr 04, 2007
Posts: 31
This has been resolved after adding a few jmx settings in catalina.bat of Tomcat.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MBean not visible in Jconsole - Help needed