3 Replies Latest reply on Apr 1, 2008 10:17 AM by Yichong Yang

    XMBean NotSerializationExceptions issue

    Yichong Yang Newbie

      I noticed it's said that a fix (ASPATCH-317) for the JMX XMBean NotSerializationException issue in 4.0.5GA version was provided when using Java 1.5 to get some MBean attributes from JBoss App server, e.g., using twiddle utility.

      Does anyone know where to obtain the fix? I also tried 4.2.0 GA, 4.2.0 CR2 and 4.2.2 GA, none of them seems to resolve this problem. Did I miss anything? In the jmx-invoke-service.xml, there's an entry as follows:

      interceptor code="org.jboss.jmx.connector.invoker.SerializableInterceptor"
      policyClass="StripModelMBeanInfoPolicy"

      which I guess should do the trick. However, it doesn't. Anyone know why and how to resolve this issue? Thanks a lot in advance!

        • 1. Re: XMBean NotSerializationExceptions issue
          Dimitris Andreadis Master

          What exactly you don't understand? Have you looked here?
          http://jira.jboss.com/jira/browse/JBAS-1955

          AFAIK, the change is in 4.2.2.GA and let's you read MBeanInfo remotely. If you try accessing non-serializable fields, it'll throw an exception, which is the "correct" behaviour, anyway.

          • 2. Re: XMBean NotSerializationExceptions issue
            Yichong Yang Newbie

            What I'm trying to do is very simple, which is using twiddle.sh to query some MBean info and their attribute values to reach the same goal as my going to the JBoss JMX console to get all I need.

            My understanding is that the fix would bypass the Serializable issue and make me go through to get any attribute value I need. And it seems this is not the case in the most recent versions including 4.2.2 GA.

            The following shows what I tried to do here:

            1) Get the attribute value for Server Info and I got it as follows:

            bash-2.05# ./twiddle.sh -s yyangxp:1099 get jboss.system:type=ServerInfo

            HostAddress=192.168.175.45
            AvailableProcessors=2
            OSArch=sparc
            OSVersion=5.9
            HostName=camaro
            JavaVendor=Sun Microsystems Inc.
            JavaVMName=Java HotSpot(TM) Server VM
            FreeMemory=68600432
            ActiveThreadGroupCount=9
            TotalMemory=133103616
            JavaVMVersion=1.5.0_08-b03
            ActiveThreadCount=117
            JavaVMVendor=Sun Microsystems Inc.
            OSName=SunOS
            MaxMemory=531628032
            JavaVersion=1.5.0_08


            2) Get the attribute value for ThreadPool info and I failed as follows:
            bash-2.05# ./twiddle.sh -s yyangxp:1099 get jboss.system:service=ThreadPool

            08:41:37,451 ERROR [Twiddle] Exec failed
            java.io.NotSerializableException: org.jboss.util.threadpool.BasicThreadPool
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
            at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
            at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
            at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
            at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
            at java.util.ArrayList.writeObject(ArrayList.java:569)
            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:917)
            at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
            at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
            at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
            at java.rmi.MarshalledObject.(MarshalledObject.java:92)
            at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:424)
            at sun.reflect.GeneratedMethodAccessor104.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:466)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
            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:133)
            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 $Proxy1.getAttributes(Unknown Source)
            at org.jboss.console.twiddle.command.GetCommand.execute(GetCommand.java:168)
            at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:305)


            So the real question is "Is there any workaround I can get non serializable MBean attribute values remotely?". I noticed you or someone else posted something at http://jira.jboss.com/jira/browse/JBAS-4323, which seems to be able to resolve the issue I have. But I have no idea how to apply this patch into my JBoss environment to make it work.

            Your further advice is very much appreciated!

            -Yichong

            • 3. Re: XMBean NotSerializationExceptions issue
              Yichong Yang Newbie

              Would anyone from JBOSS answer this question? Thanks!