2 Replies Latest reply on May 7, 2014 1:26 AM by jaikiran pai

    Serialization issue while Find sessions via MXBean

    sudhananthan B Newbie

      Hi,

       

      I'm using jboss EAP 6.1.0. My goal is to get session information like SessionPrincipals etc. So i use MXBean to achieve this as below.

       

                          ObjectName objectName = new ObjectName("jboss.web:type=Manager,path=/,host=default-host");
                          Object session = connection.invoke(objectName, "findSessions", null, null);
      

       

      While findSessions i got the error:

       

      due to org.jboss.as.web.session.AttributeBasedClusteredSession: java.io.NotSerializableException: org.jboss.as.web.session.AttributeBasedClusteredSession

          at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:891)

          at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:809)

          at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:62)

          at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:119)

          at org.jboss.remotingjmx.protocol.v2.ServerProxy$3.write(ServerProxy.java:325)

          at org.jboss.remotingjmx.protocol.v2.Common.write(Common.java:182)

          at org.jboss.remotingjmx.protocol.v2.ServerProxy.writeResponse(ServerProxy.java:315)

          at org.jboss.remotingjmx.protocol.v2.ServerProxy.access$3400(ServerProxy.java:112)

          at org.jboss.remotingjmx.protocol.v2.ServerProxy$InvokeHandler.handle(ServerProxy.java:917)

          at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1.run(ServerCommon.java:152)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

          at java.lang.Thread.run(Thread.java:722)

      Caused by: an exception which occurred:

          in object (array of org.apache.catalina.Session)@736d3c7d

       

      I even tried it from JConsole, and i got the same  (PFA Screenshot).

       

      The org.jboss.as.web.session.AttributeBasedClusteredSession is not serialized, so while transferring it remotely the issue occurs. In Current version of jboss-web AttributeBasedClusteredSession is not serialized, but in previous versions of tomcat it has been serialized(refer org.jboss.web.tomcat.tc5.session.AttributeBasedClusteredSession (Java2HTML)). Could you please tell me the reason why its not serialized.

       

      Thanks in advance,

      Sudhananthan B.