This seems like it should be simple but I can't find any helpful info online about it. I have a jboss server running and I'm trying to use twiddle to get info about various objects that are visible in the JMX console. Some return data as expected, while others give an error. Specifically these cases:
twiddle.sh -s localhost info jboss.system:type=Server twiddle.sh -s localhost get jboss.system:type=Server
twiddle.sh -s localhost info jboss:service=Naming
twiddle.sh -s localhost get jboss:service=Naming
12:49:21,579 ERROR [Twiddle] Exec failed java.io.NotSerializableException: java.lang.reflect.Method at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
The jmx console runs within the app server, so it could be that the java.lang.reflect.Method objects do not have to be serialized. On the other hand, twiddle runs in a separate JVM, thus all objects returned must be serialized.
One possible workaround is to get only the property values you need, and not the ones you don't need, such as MethodMap in this case.