6 Replies Latest reply on Nov 19, 2010 10:56 AM by Clebert Suconic

    JMX operation 'HornetQServerControl.addAddressSettings' fails

    Aspi Engineer Newbie

      Hi,

       

      We are using HQ 2.1.2.Final and I am trying to add a HQ address via JMX.

       

      Fragment of the code is:

       

      MBeanServerConnection mbsc = ...;

      ObjectName objName = ObjectNameBuilder.DEFAULT.getJMSServerObjectName();

      HornetQServerControl hqServerControl =

          (HornetQServerControl)MBeanServerInvocationHandler.newProxyInstance(mbsc, objName, HornetQServerControl.class, false);

      hqServerControl.addAddressSettings(<params>);

       

      This fails with the exception:

      Exception in thread "main" javax.management.ReflectionException: No such operation: addAddressSettings
          at com.sun.jmx.mbeanserver.PerInterface.noSuchMethod(PerInterface.java:152)
          at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:94)
          at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262)
          at javax.management.StandardMBean.invoke(StandardMBean.java:391)
          at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
          at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
          at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1426)
          at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
          at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1264)
          at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1359)
          at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
          at sun.reflect.GeneratedMethodAccessor124.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
          at sun.rmi.transport.Transport$1.run(Transport.java:159)
          at java.security.AccessController.doPrivileged(Native Method)
          at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
          at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:619)
          at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
          at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
          at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
          at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
          at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke(Unknown Source)
          at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:993)
          at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:288)
          at $Proxy0.addAddressSettings(Unknown Source)
          at com.putnam.jboss.management.jmx.CreateAddress.createAddress(CreateAddress.java:85)
          at com.putnam.jboss.management.jmx.CreateAddress.run(CreateAddress.java:57)
          at com.putnam.jboss.management.jmx.CreateAddress.main(CreateAddress.java:37)
      Caused by: java.lang.NoSuchMethodException: addAddressSettings(java.lang.String, java.lang.String, java.lang.String, boolean, int, long, int, long, long, boolean, java.lang.String)
          at com.sun.jmx.mbeanserver.PerInterface.noSuchMethod(PerInterface.java:150)
          at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:94)
          at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262)
          at javax.management.StandardMBean.invoke(StandardMBean.java:391)
          at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)

       

      What am I doing wrong?

       

      On a side note, I did some reasearch into this and here are my findings. I could be completely off track..

       

      From: http://anonsvn.jboss.org/repos/hornetq/tags/HornetQ_2_1_2_Final/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java

         @Override
         MBeanOperationInfo[] fillMBeanOperationInfo()
         {
            return MBeanInfoHelper.getMBeanOperationsInfo(HornetQServerControl.class);
         }



      But when I look at the decompiled java class, org.hornetq.core.management.impl.HornetQServerControlImpl.java from hornetq-core.jar:

      MBeanOperationInfo[] fillMBeanOperationInfo()
        {
          return MBeanInfoHelper.getMBeanOperationsInfo(NotificationEmitter.class);
        }

       

      It just seems odd that the code that is in SVN matches the code that is in the downloaded src.zip, but it does not match the compiled .class file that is in the jar corresponding to the same version. You can download the jar for yourself from:

      http://sourceforge.net/projects/hornetq/files/2.1.2.FINAL/hornetq-2.1.2.Final.zip/download

      and confirm this.

       

       

      Thanks

      Aspi Engineer

      Putnam Investments