6 Replies Latest reply on Jan 27, 2006 6:29 PM by Fabiano C. de Oliveira

    notSerializableException, (may relate to JBAS-1268)

    andy Newbie

      Hi All,

      Listed below is a cut and paste of the exception I received from running Twiddle with JBoss-4.0.3. JBAS-1268 looks like the same problem but is reported to have been fixed in 4.0.2. With 4.0.3 I get the same exception when running twiddle. Running it both ways as described below yields the same exception:

      ex 1: twiddle info "jboss:service=Naming"
      ex 2: twiddle -s localhost:1099 info "jboss:service=Naming"

      what caused me to try twiddle is that the exception surfaced while attempting to access getMBeanInfo for the above MBean in my java program, remotely attempting to access JBoss using jnp.

      Do you have any idea of what I am missing in order to access the above mentioned MBean? Or is this a defect and needs to be reported?

      Thank you

      - andy


      C:\jboss-403\jboss-4.0.3SP1\bin>twiddle -s localhost:1099 info "jboss:service=Naming"
      JAVA_HOME is not set. Unexpected results may occur.
      Set JAVA_HOME to the directory of your local JDK to avoid this message.
      07:21:59,885 ERROR [Twiddle] Exec failed
      java.io.NotSerializableException: org.jboss.mx.util.MBeanProxyExt
      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.writeObject(ObjectOutputStream.java:291)
      at java.util.HashMap.writeObject(HashMap.java:985)
      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: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.access$100(ObjectOutputStream.java:135)
      at java.io.ObjectOutputStream$PutFieldImpl.writeFields(ObjectOutputStream.java:1512)
      at java.io.ObjectOutputStream.writeFields(ObjectOutputStream.java:418)
      at javax.management.modelmbean.DescriptorSupport.writeObject(DescriptorSupport.java:1392)
      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: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.defaultWriteObject(ObjectOutputStream.java:380)
      at javax.management.modelmbean.ModelMBeanAttributeInfo.writeObject(ModelMBeanAttributeInfo.java:536)
      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: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.writeArray(ObjectOutputStream.java:1245)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)
      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.rmi.MarshalledObject.(MarshalledObject.java:92)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:410)
      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: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(StreamRemoteCall.java:247)
      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
      at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
      at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:119)
      at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:227)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:167)
      at org.jboss.jmx.connector.invoker.client.InvokerAdaptorClientInterceptor.invoke(InvokerAdaptorClientInterceptor.java:51)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
      at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:59)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
      at $Proxy0.getMBeanInfo(Unknown Source)
      at org.jboss.console.twiddle.command.InfoCommand.execute(InfoCommand.java:112)
      at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:290)
      C:\jboss-403\jboss-4.0.3SP1\bin>

        • 1. Re: notSerializableException, (may relate to JBAS-1268)
          Dimitris Andreadis Master

          This is "probably" normal, since the LookupPool attribute of type org.jboss.util.threadpool.BasicThreadPoolMBean contains an MBeanProxyExt that is not serializable, and this is attempted to be carried over to the client side as part of the attribute Descriptor.

          • 2. Re: notSerializableException, (may relate to JBAS-1268)
            andy Newbie

            Dimitris,

            Thank you for the quick response.

            If you don't mind I'd like to inquire into what "probably" means.

            I also am interested in understanding my choices for accessing this MBean as well as others.

            The same error occurred running Twiddle attempting to access the deploymentScanner MBean.

            twiddle info "jboss.deployment:type=DeploymentScanner,flavor=URL"

            BTW: in my java program I tried:

            " public class JMXBrowser implements java.io.Serializable" to received the

            following exception:


            java.io.NotSerializableException: org.jboss.mx.util.MBeanProxyExt


            What do you suggest as next steps?

            Thank you

            Andy Gordon







            • 3. Re: notSerializableException, (may relate to JBAS-1268)
              andy Newbie

              Staff at JB\oss,

              SInce I haven't received a response that tells me how to either:

              1) circumvent the problem and gain access to MBeanInfo for allJBoss MBean attributes thru RMI
              2) Enter the problem in JIRA,

              I plan to enter the problem in JIRA tomorrow unless told otherwise. I am certainly open to suggestions. Thank you.

              - Andy Gordon

              • 4. Re: notSerializableException, (may relate to JBAS-1268)
                Dimitris Andreadis Master

                Accessing mbeans remotely (r/w attributes, invoke operations) will not be a problem, as long as the exhanged data is serializalbe (which is normal).

                The problem you see is when asking for the MBeanInfo of mbeans. JBoss internally uses ModelMBeanInfo (an extension of MBeanInfo) that contains extra metadata and also javax.management.Descriptor objects containing runtime data (e.g. cached attribute values). If an attribute is of a non-serializable type and it has been set, the Descriptor will have it's cached value.

                I presume those non-serializable field should not be carried over, so (a) try first using jdk5 on both sides to pick up the sun implementation of Descriptor so we see if this is a jboss jmx implementation bug (b) open a bug report in JIRA.

                • 5. Re: notSerializableException, (may relate to JBAS-1268)
                  andy Newbie

                  Dimitris,

                  Sorry to say that JDK 1.5 is being used on both ends. Thanks for the help. I will open a defect report and look forward to seeing the fix soon. thank you

                  - Andy Gordon

                  • 6. Re: notSerializableException, (may relate to JBAS-1268)
                    Fabiano C. de Oliveira Newbie

                    Andy,

                    To prevent this proble give a look in JBAS-1955. I almost sure that this will help to solve your proble. Let me know if it does.

                    And sossy for not reply your mail, Im very busy in my company and didnt have time to test your.

                    But in truth the problem with the code that you send me it is because the IDE that not configure the lib XML like in twiddle.

                    Sorry for the late reply.