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


Reply With Quote