Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-6680

Spring beans annotated with @Transactional are not serializable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0 GA
    • Fix Version/s: 3.0.1
    • Component/s: Transaction
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      If a Spring bean in flow scope is annotated with @Transactional, the following exception is thrown when Spring Web Flow tries to serialize the scope:

      org.springframework.webflow.execution.repository.snapshot.SnapshotCreationException: Could not serialize flow execution; make sure all objects stored in flow or flash scope are serializable
      at org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshot.<init>(SerializedFlowExecutionSnapshot.java:74)
      at org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshotFactory.createSnapshot(SerializedFlowExecutionSnapshotFactory.java:70)
      at org.springframework.webflow.execution.repository.snapshot.AbstractSnapshottingFlowExecutionRepository.snapshot(AbstractSnapshottingFlowExecutionRepository.java:75)
      at org.springframework.webflow.execution.repository.impl.DefaultFlowExecutionRepository.putFlowExecution(DefaultFlowExecutionRepository.java:123)
      at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:165)
      Truncated. see log file for complete stacktrace
      java.io.NotSerializableException: java.lang.Object
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
      Truncated. see log file for complete stacktrace

        Activity

        Hide
        mnoda Mauricio Noda added a comment -

        Thanks! It is working perfectly in Spring 3.0.1.

        Show
        mnoda Mauricio Noda added a comment - Thanks! It is working perfectly in Spring 3.0.1.

          People

          • Assignee:
            juergen.hoeller Juergen Hoeller
            Reporter:
            mnoda Mauricio Noda
            Last updater:
            Trevor Marshall
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              7 years, 43 weeks, 2 days ago