• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

MBean not visible in Jconsole - Help needed

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Priyadarshan Kelkar
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This has been resolved after adding a few jmx settings in catalina.bat of Tomcat.
reply
    Bookmark Topic Watch Topic
  • New Topic