3 Replies Latest reply on Jun 7, 2004 5:45 PM by adrian.brock

    3.2.4: managed parameter name cannot have spaces

    duslow

      In migrating from 3.2.3 to 3.2.4, I found that spaces in the XDoclet managed-parameter name attribute of an XMBean no longer work. For example:

      * @jmx.managed-parameter name="Some Name" type="java.lang.String" description="Some Description"


      When the resulting SAR is deployed, JBoss 3.2.4 throws an exception stating that the XMBean is not a valid. In JBoss 3.2.3, the SAR deployed just fine.

      Taking the space out of the parameter name cures the exception.

      * @jmx.managed-parameter name="SomeName" type="java.lang.String" description="Some Description"


      I'm posting this just as an FYI for anyone else who may run into this minor snag when migrating to 3.2.4 from previous releases.

      Is there a reason spaces in the name are no longer valid?

        • 1. Re: 3.2.4: managed parameter name cannot have spaces
          raja05

          Yes because it maps to a method name and methods cant have spaces

          • 2. Re: 3.2.4: managed parameter name cannot have spaces
            duslow

            Thanks for the feedback, but I'm not sure what you say is correct in this case.

            In 3.2.3, the jmx.managed-parameter name attribute was just the name that would be displayed above the input field on the jmx-console gui. It had nothing to do with the actual name of the parameter being passed into the method. Nor did it indicate the name of a setter method to call.

            Plus I don't have any methods named "SomeName". Notice that the XDoclet tag examples I gave in my original post was "jmx.managed-parameter".

            What I do have is:

            /**
             *@jmx:managed-operation description="Does Something"
             *@jmx.managed-parameter name="SomeName" type="java.lang.String" description="Some Description"
            **/
            public String doSomething(String something)
            


            This works in 3.2.4 as long as "SomeName" doesn't have a space. In 3.2.3, it also worked if the name was "Some Name" as well.

            It's not a big deal. I'm just more curious as to why the change since in 3.2.3 since name was (or at least seemed to be) just a display thing.



            • 3. Re: 3.2.4: managed parameter name cannot have spaces

              This is due to a change in the spec, that has since been reverted.
              The requirement was that all jmx attributes and operations should be valid java
              names.

              Frankly the JMX spec is a mess, e.g. see the clarification of currencyTimeLimit
              in the latest errata.
              http://java.sun.com/products/JavaManagement/jmx-1.2-errata.html