Announcement Announcement Module
Collapse
No announcement yet.
problem with MBean Desctiption Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • problem with MBean Desctiption

    Hi guyz this is my first post on this forum, and really hope to get a solution.

    I ve developed a really simple MBean and deployed it on JBoss, it works fine except the description for attributes and MBean is not getting displayed.

    This is my MBean

    package com.jmx;
    /**
    *
    * @author faisal
    */

    /**
    *@@org.springframework.jmx.export.metadata.Managed Resource
    *(description="my mbean", objectName="spring:bean=test", log=true, logFile="jmxlog.log"
    * currencyTimeLimit=15, persistPolicy="OnUpdate", persistPersion=200, persistLocation="foo", persistName="bar")
    *
    */
    public class JMXTestBean
    {
    /**
    *Holds value of property name.
    */
    private String name;

    /**
    * Getter for property name.
    * @return Value of property name.
    * @@org.springframework.jmx.export.metadata.ManagedA ttribute
    * (description="my name", currencyTimeLimit=15)
    */
    public String getName()
    {
    return this.name;
    }

    /**
    * Setter for property name.
    * @param name New value of property name.
    * @@org.springframework.jmx.export.metadata.ManagedA ttribute
    * (description="my name", currencyTimeLimit=15)
    */
    public void setName(String name)
    {
    this.name = name;
    }

    /**
    * Holds value of property age.
    */
    private int age;

    /**
    * Getter for property age.
    * @return Value of property age.
    * @@org.springframework.jmx.export.metadata.ManagedA ttribute
    * (description="my name", currencyTimeLimit=15)
    */
    public int getAge()
    {
    return this.age;
    }

    /**
    * Setter for property age.
    * @param age New value of property age.
    */
    public void setAge(int age)
    {
    this.age = age;
    }

    }

    and this is MBean descriptor
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
    <bean id="exporter" class="org.springframework.jmx.export.MBeanExporte r">
    <property name="beans">
    <map>
    <entry key="bean:name=testBean1">
    <ref local="testBean" />
    </entry>
    </map>
    </property>
    </bean>

    <bean id="testBean" class="com.jmx.JMXTestBean">
    <property name="name" value="faisal" />
    <property name="age" value="15" />
    </bean>

    <bean id="attriuteSoruce" class="org.springframework.jmx.export.metadata.Att ributesJmxAttributeSource">
    <property name="attributes">
    <bean class="org.springframework.metadata.commons.Common sAttributes" />
    </property>
    </bean>

    <bean id="assembler" class="org.springframework.jmx.export.assembler.Me tadataMBeanInfoAssembler">
    <property name="attributeSource">
    <ref local="attriuteSoruce"/>
    </property>
    </bean>
    </beans>

    and here is my web.xml snippet

    <servlet>
    <servlet-name>spring</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    <init-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/spring-jmx-bean-descriptor.xml</param-value>
    </init-param>
    </servlet>

    i'll really appreciate any solution or pointer or anything

  • #2
    Try using the latest spring version and if possible, outside jboss (just on tomcat) - I know JBoss uses its own implementation which raises some issues from time to time.
    If the problem persists raise an issue on jira please. Thanks.

    Comment


    • #3
      MBean description Problem

      i am using spring 1.2.6.
      jboss show nice web view of MBean with JMX console, how am i going to view MBean whe using tomcat(plz do realize i am JMX newb.)

      Comment


      • #4
        Try spring 1.2.8 - I realize it's not easy but a good way to start is to read the tomcat documentation (http://tomcat.apache.org/tomcat-5.5-doc/index.html). However, before that try another jmx console like mc4j - do a quick google and you'll find plenty of implementations from desktop to web based.
        It might be a problem with the jmx console from Jboss.

        Comment

        Working...
        X