Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-3984

Problem while serialization of POJO components during session replication

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.1.1.GA
    • Fix Version/s: 2.1.2.CR1
    • Component/s: Core
    • Labels:
      None
    • Environment:

      Windows

    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Modify jboss-seam-2.1.1.GA\src\main\org\jboss\seam\transaction\TransactionInterceptor.java :

      from: private Map<AnnotatedElement,TransactionMetadata> transactionMetadata = new HashMap<AnnotatedElement, TransactionMetadata>();
      to: private transient Map<AnnotatedElement,TransactionMetadata> transactionMetadata = new HashMap<AnnotatedElement, TransactionMetadata>();

      Show
      Modify jboss-seam-2.1.1.GA\src\main\org\jboss\seam\transaction\TransactionInterceptor.java : from: private Map<AnnotatedElement,TransactionMetadata> transactionMetadata = new HashMap<AnnotatedElement, TransactionMetadata>(); to: private transient Map<AnnotatedElement,TransactionMetadata> transactionMetadata = new HashMap<AnnotatedElement, TransactionMetadata>();

      Description

      On replication of conversation scoped seam components referencing an stateless EJB you get:
      14:23:01,480 ERROR [JBossCacheService] externalizeSession(): exception occurred
      externalizing session SessionBasedClusteredSession[id: yQ8dwYuawaXaMRejYNyIWA**.
      node1 lastAccessedTime: 1236169379964 version: 46 lastOutdated: 0]
      java.io.NotSerializableException: java.lang.reflect.Method
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)

      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
      at java.util.HashMap.writeObject(HashMap.java:984)
      at sun.reflect.GeneratedMethodAccessor153.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:89
      0)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:13
      33)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav
      a:1284)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)

      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java
      :1369)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:13
      41)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav
      a: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.GeneratedMethodAccessor154.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:89
      0)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:13
      33)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav
      a:1284)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)

      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java
      :1369)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:13
      41)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav
      a:1284)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)

      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
      at java.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.

      Cluster was composed of 2 nodes. Each node on a different machine.

      I have tryed to follow the hints of http://markmail.org/message/lhf5tsnwczsonp7e#query:Seam%20TransactionMetadata%20serializable+page:1+mid:lhf5tsnwczsonp7e+state:results

      so that i made userTransactionas transient. After this change, all started to work.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                norman.richards Norman Richards
                Reporter:
                mar1u50 Marius Oancea
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: