6 Replies Latest reply on Jul 14, 2017 3:58 AM by jaikiran pai

    JBAS010322: Failed to load session  pMRsDmtV8VaQyMdQSv4EiEvR: java.lang.RuntimeException: JBAS010333: Failed to  load session attributes for session: pMRsDmtV8VaQyMdQSv4EiEvR

    Dzmitry Yakimovich Newbie

      Hi,

      I've got an error while JBoss EAP 6.1 is trying to de-serialize my session attribute:

      06:01:32,578 WARN  [org.jboss.as.clustering.web.infinispan] (ajp-/10.152.96.154:8109-2) JBAS010322: Failed to load session pMRsDmtV8VaQyMdQSv4EiEvR: java.lang.RuntimeException: JBAS010333: Failed to load session attributes for session: pMRsDmtV8VaQyMdQSv4EiEvR

        at org.jboss.as.clustering.web.infinispan.DistributedCacheManager$2.invoke(DistributedCacheManager.java:229)

        at org.jboss.as.clustering.web.infinispan.DistributedCacheManager$2.invoke(DistributedCacheManager.java:212)

        at org.jboss.as.clustering.infinispan.invoker.SimpleCacheInvoker.invoke(SimpleCacheInvoker.java:34)

        at org.jboss.as.clustering.infinispan.invoker.BatchCacheInvoker.invoke(BatchCacheInvoker.java:48)

        at org.jboss.as.clustering.infinispan.invoker.RetryingCacheInvoker.invoke(RetryingCacheInvoker.java:81)

        at org.jboss.as.clustering.web.infinispan.DistributedCacheManager$ForceSynchronousCacheInvoker.invoke(DistributedCacheManager.java:550)

        at org.jboss.as.clustering.web.infinispan.DistributedCacheManager.getData(DistributedCacheManager.java:238)

        at org.jboss.as.clustering.web.infinispan.DistributedCacheManager.getSessionData(DistributedCacheManager.java:196)

        at org.jboss.as.web.session.DistributableSessionManager.loadSession(DistributableSessionManager.java:1395) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.web.session.DistributableSessionManager.findSession(Distributable SessionManager.java:681) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.web.session.DistributableSessionManager.findSession(Distributable SessionManager.java:84) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.apache.catalina.connector.Request.doGetSession(Request.java:2605) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.catalina.connector.Request.getSession(Request.java:2357) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:99) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:488) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:420) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_55]

      Caused by: java.lang.ClassCastException: org.test.ValueWrapper cannot be cast to java.lang.String

        at org.jboss.marshalling.ModularClassResolver.resolveClass(ModularClassResolver.java:103)

        at org.jboss.as.clustering.ClassLoaderAwareClassResolver.resolveClass(ClassLoaderAwareClassResolver.java:92)

        at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:893)

        at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:310)

        at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)

        at org.jboss.marshalling.river.RiverUnmarshaller.doReadMapObject(RiverUnmarshaller.java:195)

        at org.jboss.marshalling.river.RiverUnmarshaller.readMapData(RiverUnmarshaller.java:794)

        at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:685)

        at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)

        at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1678)

        at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1594)

        at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1236)

        at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272)

        at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)

        at org.jboss.marshalling.river.RiverUnmarshaller.doReadMapObject(RiverUnmarshaller.java:195)

        at org.jboss.marshalling.river.RiverUnmarshaller.readMapData(RiverUnmarshaller.java:794)

        at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:682)

        at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)

        at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37)

        at org.jboss.as.clustering.SimpleMarshalledValue.get(SimpleMarshalledValue.java:122)

        at org.jboss.as.clustering.web.impl.SessionAttributeMarshallerImpl.unmarshal(SessionAttributeMarshallerImpl.java:72)

        at org.jboss.as.clustering.web.infinispan.CoarseSessionAttributeStorage.load(CoarseSessionAttributeStorage.java:64)

        at org.jboss.as.clustering.web.infinispan.DistributedCacheManager$2.invoke(DistributedCacheManager.java:227)

      ... 21 more

      Caused by: an exception which occurred:

        in map value at index [0] of size [1]

        in field mProperties

        in object of type org.test.ValueWrapper

        in map value at index [1] of size [16]

       

      While spending more time on investigating this issue I've found that the problem is around de-serializing empty array property. Let's say my session attribute is a an object of class ValueWrapper(serializable class) and it has a map property with value object which is empty array, like "new Person[] {}" (where Person is serializable). And JBoss is throwing those exception above while de-serializing such empty array object. I definitely know that the problem is with empty array since replacing it to empty list is resolving the issue.

      Is it a known issue and any workaround available other than refactoring my code and replacing arrays to lists?

      Plus I think there is one more issue here:

      "Caused by: java.lang.ClassCastException: org.test.ValueWrapper cannot be cast to java.lang.String

        at org.jboss.marshalling.ModularClassResolver.resolveClass(ModularClassResolver.java:103)"

      Looks like original problem was swallowed somewhere and marshalling code is trying to cast my object to String at ModularClassResolver.java:103