mbean definition doesn't work moving from 3.2.5 to 4.0.4
rkapil Sep 14, 2006 3:45 PMSorry if this is a redundant question. I searched the board and found something similar, but I still don't know what changes I need to make in my xml file. It works fine in JBoss 3.2.5, but throws an exception in 4.0.4.
Any help would be appreciated.
Here is the file:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mbean PUBLIC "-//JBoss//DTD JBOSS XMBEAN 1.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_0.dtd"> <mbean> <description>This is the module responsible for processing logins, and has gauges defined describing its state.</description> <descriptors> <persistence/> </descriptors> <class>com.company.auth.login.AsmLoginMonitor</class> <!--attributes--> <attribute access="read-write" getMethod="getAsmLoginModuleLoginAttemptsRateWindowTimeInMillis" setMethod="setAsmLoginModuleLoginAttemptsRateWindowTimeInMillis"> <description>Gets the rate window time for the AsmLoginModule attempts in milliseconds.</description> <name>AsmLoginModuleLoginAttemptsRateWindowTimeInMillis</name> <type>long</type> <descriptors> <persistence/> </descriptors> </attribute> <attribute access="read-write" getMethod="getAsmLoginModuleLoginAttemptsSubRateWindowTimeInMillis" setMethod="setAsmLoginModuleLoginAttemptsSubRateWindowTimeInMillis"> <description>Gets the rate window time for the AsmLoginModule attempts in milliseconds.</description> <name>AsmLoginModuleLoginAttemptsSubRateWindowTimeInMillis</name> <type>long</type> <descriptors> <persistence/> </descriptors> </attribute> <attribute access="read-only" getMethod="getCurrentAsmLoginModuleFailureRate"> <description>Returns the current number of failures in the current window.</description> <name>CurrentAsmLoginModuleFailureRate</name> <type>int</type> <descriptors> <persistence/> </descriptors> </attribute> <attribute access="read-only" getMethod="getCurrentAsmLoginModuleSuccessRate"> <description>Returns the current number of successes in the current window.</description> <name>CurrentAsmLoginModuleSuccessRate</name> <type>int</type> <descriptors> <persistence/> </descriptors> </attribute> <attribute access="read-only" getMethod="getAsmLoginModuleFailurePercentage"> <description>Returns the current percentage of failures in the current window.</description> <name>AsmLoginModuleFailurePercentage</name> <type>float</type> <descriptors> <persistence/> </descriptors> </attribute> <attribute access="read-only" getMethod="getAsmLoginModuleSuccessPercentage"> <description>Returns the current percentage of successes in the current window.</description> <name>AsmLoginModuleSuccessPercentage</name> <type>float</type> <descriptors> <persistence/> </descriptors> </attribute> <attribute access="read-only" getMethod="getAsmLoginModuleAverageTiming"> <description>Returns the average time, over the sub window, taken to execute the login.</description> <name>AsmLoginModuleAverageTiming</name> <type>float</type> <descriptors> <persistence/> </descriptors> </attribute> <attribute access="read-only" getMethod="getActiveDirectoryAverageTiming"> <description>Returns the average time, over the sub window, taken to execute the ActiveDirectory login.</description> <name>ActiveDirectoryAverageTiming</name> <type>float</type> <descriptors> <persistence/> </descriptors> </attribute> <!--artificial attributes--> <!--operations --> <operation impact="ACTION_INFO"> <description>Returns all login attempts over the entire window.</description> <name>getAllAsmLoginAttempts</name> <return-type>java.util.Collection</return-type> <descriptors> </descriptors> </operation> <operation impact="ACTION_INFO"> <description>Returns all login attempts over the entire window for a particular user.</description> <name>getAllAsmLoginModuleAttemptsForUser</name> <parameter> <description>(no description)</description> <name>username</name> <type>java.lang.String</type> </parameter> <return-type>java.util.Collection</return-type> <descriptors> </descriptors> </operation> <operation impact="ACTION_INFO"> <description>Returns all AD login attempts over the entire window.</description> <name>getAllActiveDirectoryAttempts</name> <parameter> <description>(no description)</description> <name>username</name> <type>java.lang.String</type> </parameter> <return-type>java.util.Collection</return-type> <descriptors> </descriptors> </operation> <operation impact="ACTION_INFO"> <description>Returns all AD login attempts over the entire window for a particular user.</description> <name>getAllActiveDirectoryAttemptsForUser</name> <parameter> <description>(no description)</description> <name>username</name> <type>java.lang.String</type> </parameter> <return-type>java.util.Collection</return-type> <descriptors> </descriptors> </operation> <operation impact="ACTION_INFO"> <description>Returns all AD login attempts over the entire window for a particular user.</description> <name>getAllActiveDirectoryAttemptsForProviderURL</name> <return-type>java.util.Collection</return-type> <descriptors> </descriptors> </operation> <operation impact="ACTION_INFO"> <description>Returns all unique provider urls used in making Active Directory calls from the ActiveDirectoryAuthenticationProvider.</description> <name>getAllUniqueActiveDirectoryProviderURLs</name> <return-type>java.util.Collection</return-type> <descriptors> </descriptors> </operation> <operation impact="ACTION_INFO"> <description>Returns the number of attempts to a particular Provider URL.</description> <name>getActiveDirectoryProviderURLCount</name> <parameter> <description>(no description)</description> <name>providerUrl</name> <type>java.lang.String</type> </parameter> <return-type>int</return-type> <descriptors> </descriptors> </operation> <operation impact="ACTION_INFO"> <description>Appends the attempt to the rate window.</description> <name>addAsmLoginModuleAttempt</name> <parameter> <description>(no description)</description> <name>username</name> <type>java.lang.String</type> </parameter> <parameter> <description>(no description)</description> <name>result</name> <type>java.io.Serializable</type> </parameter> <parameter> <description>(no description)</description> <name>time</name> <type>java.lang.Long</type> </parameter> <return-type>void</return-type> <descriptors> </descriptors> </operation> <operation impact="ACTION_INFO"> <description>Appends the attempt to the rate window.</description> <name>addActiveDirectoryAttempt</name> <parameter> <description>(no description)</description> <name>username</name> <type>java.lang.String</type> </parameter> <parameter> <description>(no description)</description> <name>domain</name> <type>java.lang.String</type> </parameter> <parameter> <description>(no description)</description> <name>providerUrl</name> <type>java.lang.String</type> </parameter> <parameter> <description>(no description)</description> <name>result</name> <type>java.io.Serializable</type> </parameter> <parameter> <description>(no description)</description> <name>time</name> <type>java.lang.Long</type> </parameter> <return-type>void</return-type> <descriptors> </descriptors> </operation> <!--artificial operations--> <!--notifications --> </mbean>
And here is the error message on startup:
Caused by: RuntimeOperationsException: null Cause: java.lang.IllegalArgumentException: Invalid role, for operation 'getAllAsmLoginAttempts' expected 'getter' but got: operation at javax.management.modelmbean.ModelMBeanOperationInfo.isOperationDescriptorValid(ModelMBeanOperationInfo.java:232) at javax.management.modelmbean.ModelMBeanOperationInfo.setDescriptor(ModelMBeanOperationInfo.java:213) at javax.management.modelmbean.ModelMBeanOperationInfo.<init>(ModelMBeanOperationInfo.java:159) at org.jboss.mx.metadata.JBossXMBean10.buildOperationInfo(JBossXMBean10.java:323) at org.jboss.mx.metadata.JBossXMBean10.buildMBeanMetaData(JBossXMBean10.java:239) at org.jboss.mx.metadata.JBossXMBean10.build(JBossXMBean10.java:119) ... 92 more Caused by: java.lang.IllegalArgumentException: Invalid role, for operation 'getAllAsmLoginAttempts' expected 'getter' but got: operation ... 98 more