Uploaded image for project: 'Spring Web Flow'
  1. Spring Web Flow
  2. SWF-775

java.io.NotSerializableException: org.springframework.orm.jpa.SharedEntityManagerCreator

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.1
    • Component/s: None
    • Labels:
      None

      Description

      I have defined a JSF 'managed bean' as an ordinary Spring bean as follows:

      <bean id="pipeline" class="com.mazda.poc.bb.PipelinePage" scope="flow" >
      <property name="productLineManager" ref="productLineService" />
      <property name="productDescriptionManager" ref="productDescriptionService" />
      <property name="pipelineManager" ref="pipelineService" />
      </bean>

      The bean refers a number of service classes, like eg

      @Service("pipelineService")
      @Repository
      public class PipelineManagerImpl implements PipelineManager, Serializable {

      private EntityManager em;

      @PersistenceContext
      public void setEntityManager(EntityManager em)

      { this.em = em; }

      public List<Pipeline> findByCriteria(String nscId, String productLine, String body, String fuel)

      { return this.em.createQuery("from Pipeline").getResultList(); }

      public void create(Pipeline ppln)

      { ppln.setPipId(null); em.persist(ppln); }

      public void save(Pipeline ppln)

      { ppln.setLastUpdateUser("demo"); em.persist(ppln); }

      public void remove(Pipeline ppln)

      { em.remove(ppln); }

      }

      Spring Web Flow tries to serialize the managed bean (and the beans referred by it) in session. That's when the error occurs:

      java.io.NotSerializableException: org.springframework.orm.jpa.SharedEntityManagerCreator

      Because the EntityManager cannot be serialized. What's wrong? Should I do this otherwise?

        Attachments

          Activity

            People

            Assignee:
            jeremyg484 Jeremy Grelle
            Reporter:
            cbonami Christian Bonami
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: