5 Replies Latest reply on Jun 1, 2010 2:09 PM by jaikiran

    twiddle get command will not display some MBean attributes

    saltnlight5

      Hi all,

       

      I am using JBoss5, and I noticed that twiddle get command will not return attribute readings on some MBeans. Here are some examples:

       

       

      ## this is working
      $ bin/twiddle.sh get jboss.system:type=ServerInfo
      ActiveThreadCount=65
      AvailableProcessors=2
      OSArch=x86
      MaxMemory=477233152
      HostAddress=127.0.0.1
      JavaVersion=1.6.0_20
      OSVersion=5.1
      JavaVendor=Sun Microsystems Inc.
      TotalMemory=288096256
      ActiveThreadGroupCount=8
      OSName=Windows XP
      FreeMemory=71270000
      HostName=myhost
      JavaVMVersion=16.3-b01
      JavaVMVendor=Sun Microsystems Inc.
      JavaVMName=Java HotSpot(TM) Server VM
      
      ## this run, but nothing is displyed, and no error either.
      $ bin/twiddle.sh get jboss.messaging.destination:service=Queue,name=DLQ
      
      ## but this works
      $ bin/twiddle.sh get jboss.messaging.destination:service=Queue,name=DLQ MessageCount
      MessageCount=0
      
      ## but then this will not (doesn't display anything, and no error)
      $ bin/twiddle.sh get jboss.messaging.destination:service=Queue,name=DLQ MessageCounter
      

       

       

      I also notice if I do a get query of MBean that doesn't exist, it will not error, but silently returned with nothing. I rather it throws an error telling me the MBean doesn't exist. For example:

       

       

      ## get some fake mbean (run with out error!)
      $ bin/twiddle.sh get someFakeDomain:foo=bar
      

       

      Are all these normal with jboss twiddle tool?

        • 1. Re: twiddle get command will not display some MBean attributes
          saltnlight5

          Can anyone provide some feedback here?

          • 2. Re: twiddle get command will not display some MBean attributes
            jaikiran

            Zemian Deng wrote:

             

             

            I also notice if I do a get query of MBean that doesn't exist, it will not error, but silently returned with nothing. I rather it throws an error telling me the MBean doesn't exist. For example:

             

             

            ## get some fake mbean (run with out error!)
            $ bin/twiddle.sh get someFakeDomain:foo=bar
            

             

             

            Which version of JBoss AS are you using? And are you sure, no one changed the twiddle script? I just tried this on JBoss AS 5.1.0 and get an error (as expected):

             

            [jpai@localhost bin]$ ./twiddle.sh get someFakeDomain:foo=bar
            18:22:52,196 ERROR [Twiddle] Exec failed
            javax.management.InstanceNotFoundException: someFakeDomain:foo=bar is not registered.
                    at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:526)
                    at org.jboss.mx.server.MBeanServerImpl.getMBeanInfo(MBeanServerImpl.java:675)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at org.jboss.jmx.connector.invoker.InvokerAdaptorService.invoke(InvokerAdaptorService.java:263)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
                    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
                    at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
                    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
                    at org.jboss.jmx.connector.invoker.SerializableInterceptor.invoke(SerializableInterceptor.java:74)
                    at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
                    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                    at org.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMPProxyFactory.java:180)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
                    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                    at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:855)
                    at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:422)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    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)
            • 3. Re: twiddle get command will not display some MBean attributes
              jaikiran

              Also, the rest of the MBeans which you say don't return any result, fail (as expected) on my system.

              • 4. Re: twiddle get command will not display some MBean attributes
                saltnlight5

                Ahh crap, it is my installation. Not sure what/how it got changed it, but when I unzip a new JBoss5 installation, it started to work as expected, which prints out those exception stack.

                 

                $ bin/twiddle.sh get jboss.messaging.destination:service=Queue,name=DLQ MessageCounter
                13:17:25,137 ERROR [Twiddle] Exec failed
                java.io.NotSerializableException: org.jboss.jms.server.messagecounter.MessageCounter$DayCounter
                        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
                        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
                        at java.util.ArrayList.writeObject(ArrayList.java:570)
                ...
                

                 

                Now to understand the error, I suppose that jmx-console works because it inside the jboss server VM and doesn't need to come across network, while twiddle is a JMX client that must serialize the bean across and failed?

                 

                Thanks for verifying for me jaikiran!

                • 5. Re: twiddle get command will not display some MBean attributes
                  jaikiran

                  Zemian Deng wrote:

                   

                  Now to understand the error, I suppose that jmx-console works because it inside the jboss server VM and doesn't need to come across network, while twiddle is a JMX client that must serialize the bean across and failed?

                   

                   

                  That's correct.