Announcement Announcement Module
No announcement yet.
Some MBeans do, some MBeans don't... Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Some MBeans do, some MBeans don't...

    Here's something odd: I'm working with Spring's JMX support for the first time today (very impressive), and it's working great for the first two beans I've exposed. But now I'm exposing two or three more, and the new one's don't show up in JConsole.

    I'm running my app within Tomcat 6, and using JConsole to sniff 'em out. Here's a snippet of my spring config:

    <!-- JMX -->
    <context:mbean-export />
    <bean id="registry" class="org.springframework.remoting.rmi.RmiRegistryFactoryBean">
      <property name="port" value="1099"/>
    <bean id="serverConnector"
     <property name="objectName" value="connector:name=rmi"/>
     <property name="serviceUrl" 
    You can see here I'm all setup for remote access, not that I'm using it at present. Now here is a snippet of some code from one of my beans that appears correctly in JConsole:

    	description="Lets you control the logging level", 
    	log=false )
    public class Log4jMBean {
    	@ManagedOperation(description="Set logging to INFO level")
        public void activateInfo(String category) {
    ...You can tell I'm using jdk 5+ and relying on an @Component annotation in this case to register the bean. The Spring annotations for @ManagedResource, @ManagedOperation, and @ManagedAttribute seem to be working just fine...

    ...And here is a snippet of some code from one of my beans that does not appear in JConsole:

    		description="Lets you control the Main MDPOJO", 
    		log=false )
    public class JmsMessageListener implements MessageListener {
     boolean			bypassAll	=	false;
     @ManagedAttribute(description="true=bypass" )	
     public boolean isBypassAll() {		return bypassAll;	}
     @ManagedAttribute(description="true=bypass" )
     public void setBypassAll(boolean bypassAll) {	
       this.bypassAll = bypassAll;	
    Some of my beans have @ManagedAttributes, some have @ManagedOperations, , and some have both, but that doesn't seem to have an affect. Some of my beans are defined within the Spring config, some are defined with the @Component annotations, but that doesn't seem to have an affect either. I'm sure I've missed something here. But I can't figure out what.

    This isn't really high priority, but I'm wondering if anyone could offer some ideas.

    Thanks in advance,