Retrieve system properties via twiddle

2.3k views Asked by At

I am trying to retrieve system properties from JMX-console using twiddle in jboss4.3.

The following command works and provides me value of a single property...

twiddle.sh -u<username> -p<password> -Djnp.disableDiscovery 
--server=localhost:<port>
invoke 'jboss:name=SystemProperties,type=Service' get 
<SYSTEM PROPERTY NAME>

But when i try to get all properties in a single attempt it doesn't work...

twiddle.sh -u<username> -p<password> -Djnp.disableDiscovery 
--server=localhost:<port> 
invoke 'jboss:name=SystemProperties,type=Service' showAll

and shows following exception:

00:02:21,773 ERROR [Twiddle] Exec failed
java.lang.reflect.UndeclaredThrowableException
        at $Proxy0.invoke(Unknown Source)
        at org.jboss.console.twiddle.command.InvokeCommand.invoke(InvokeCommand.java:234)
        at org.jboss.console.twiddle.command.InvokeCommand.execute(InvokeCommand.java:282)
        at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:306)
Caused by: java.lang.ClassNotFoundException: org.jboss.varia.property.SystemPropertiesService$HTMLMap (no security manager: RMI class loader disabled)
        at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:375)
        at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
        at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
        at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
        at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
        at java.rmi.MarshalledObject.get(MarshalledObject.java:142)
        at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:134)
        at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)
        at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)
        at org.jboss.jmx.connector.invoker.client.InvokerAdaptorClientInterceptor.invoke(InvokerAdaptorClientInterceptor.java:66)
        at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
        at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
        at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
        ... 4 more

Any clues??

EDIT

After adding properties-plugin.jar the error changes to this:

01:51:36,366 ERROR [Twiddle] Exec failed
java.lang.RuntimeException: No property editor for type: class org.jboss.varia.property.SystemPropertiesService$HTMLMap
        at org.jboss.util.propertyeditor.PropertyEditors.getEditor(PropertyEditors.java:176)
        at org.jboss.console.twiddle.command.InvokeCommand.invoke(InvokeCommand.java:244)
        at org.jboss.console.twiddle.command.InvokeCommand.execute(InvokeCommand.java:282)
        at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:306)
1

There are 1 answers

7
Vadzim On BEST ANSWER

The reason of this error is that showAll returns object of custom class org.jboss.varia.property.SystemPropertiesService$HTMLMap that is not present on twiddle's classpath.

Just add to your twiddle.sh:

JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_HOME/server/default/lib/properties-plugin.jar"

Note, it's for JBoss 4.x. You didn't mention version. But stacktrace suggests that it is JBoss 4.x.