Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001390 [Resin] major always 10-05-06 09:19 10-01-06 14:25
Reporter maltem View Status public  
Assigned To ferg
Priority urgent Resolution fixed  
Status closed   Product Version 3.0.21
Summary 0001390: Issues with registering Mbeans
Description After upgrading to 3.0.21, we started receiving the following exception for one of our MBeans:

2006-10-02 14:05:42 PDT] <SystemStartup> System - ERROR: Problem create HTTP Connector.
Exception: bad getter arg count
        at com.caucho.jmx.IntrospectionMBean.introspect(
        at com.caucho.jmx.IntrospectionMBean.<init>(
        at com.caucho.jmx.IntrospectionMBean.<init>(
        at com.caucho.jmx.AbstractMBeanServer.createMBean(
        at com.caucho.jmx.AbstractMBeanServer.registerMBean(
Caused by: bad getter arg count
        ... 10 more
Additional Information One of our engineers has tracked down the problem, please find his analysis below.
Please let us know when we can expect this issue to be resolved.

Looks like a bug was instroduced in com.caucho.jmx.IntrospectionMBean. In the introspect(..) method there is a piece of code that handles cases where the class has a setter without a getter. In that scenario the code adds a attribute with null getter method. The MBeanAttributeInfo constructor is called with 4 attributes. It expects a getter method as 3rd attribute? and the implementation is passing in the setter which takes one argument? getters are not supposed have any arguments? hence \"bad getter arg count\" exception.

Here is the code from 3.0.21 and 3.0.14(version on my local) for comparision
----------------------------------------- Introspect(..) - lines 500-524

        else if (methodName.startsWith(\"set\") && args.length == 1) {
          String name = methodName.substring(3);

          Method getter = getGetter(methods, name, args[0]);

          if (getter == null) {
            String attributeName;

            if (isLowercaseAttributeNames) {
              StringBuilder builder = new StringBuilder(name);
              builder.setCharAt(0, Character.toLowerCase(builder.charAt(0)));
              attributeName = builder.toString();
              attributeName = name;

        if (attributes.get(attributeName) == null) {
                 new MBeanAttributeInfo(attributeName,
----------------------------------------------------------- : constructor code

    public MBeanAttributeInfo(String name,
                  String description,
                  Method getter,
                  Method setter) throws IntrospectionException {
         attributeType(getter, setter), --->> Exception is thrown in this method.
         (getter != null),
         (setter != null),

I compared it with the src from the version I am running.. 3.0.14:

Code from version 3.0.14:
----------------------------------------- Introspect(..) - lines 355-362

    else if (methodName.startsWith(\"set\") && args.length == 1) {
      String name = methodName.substring(3);

      Method getter = getGetter(methods, name, args[0]);

      if (getter == null)
        attributes.add(new MBeanAttributeInfo(name, name, null, method)); --->> notice order of parameters.
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
10-05-06 09:19 maltem New Issue
10-10-06 08:01 sam Priority normal => urgent
10-10-06 08:01 sam Additional Information Updated
10-01-06 14:25 ferg Assigned To  => ferg
10-01-06 14:25 ferg Status new => closed
10-01-06 14:25 ferg Resolution open => fixed
10-01-06 14:25 ferg Fixed in Version  => 3.0.22

Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker