0 Replies Latest reply on Jul 5, 2006 11:27 AM by J-C jc

    NotSerializableException using some MBeans with JConsole or

    J-C jc Apprentice

      I try to invoke a MBeans method from a client application (a swing app outside of the application server). I ge the the following exception:

      java.io.NotSerializableException: org.jboss.system.ServiceController$ServiceProxy
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
       at java.util.LinkedList.writeObject(LinkedList.java:755)
       at sun.reflect.GeneratedMethodAccessor131.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
       at java.util.ArrayList.writeObject(ArrayList.java:569)
       at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
       at java.rmi.MarshalledObject.<init>(MarshalledObject.java:92)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:424)
       at sun.reflect.GeneratedMethodAccessor134.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
       at sun.rmi.transport.Transport$1.run(Transport.java:153)
       at java.security.AccessController.doPrivileged(Native Method)
       at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
       at java.lang.Thread.run(Thread.java:595)
       at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
       at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
       at sun.rmi.server.UnicastRef.invoke(Unknown Source)
       at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
       at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:133)
       at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:331)
       at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:194)
       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)
       at $Proxy0.invoke(Unknown Source)
      


      My source code is :
      InitialContext ctx = new InitialContext();
      MBeanServerConnection s = (MBeanServerConnection) ctx
       .lookup("jmx/invoker/RMIAdaptor");
       ObjectName deployerMBeanName = new ObjectName("jboss.system:service=ServiceController");
       Object o = s.invoke(deployerMBeanName, "listIncompletelyDeployed", new Object[0], new String[0]);
      


      I have the same problem when I try to invoke ths method from JConsole.

      It seems that some MBeans methods works fine in jmx-console but not in JConsole due to problem of serialization.

      Is is a known problem ? Is there some workaround ?

      My goal was just to check if all beans have been deployed successfully.