Announcement Announcement Module
Collapse
No announcement yet.
EclipseLink, Toplink NotSerializableException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • EclipseLink, Toplink NotSerializableException

    I have a basic crud application (SWF2, Spring-security, JPA) that works correctly by using Hibernate Entity Manager as JPA implementation.
    when i try to use toplink or eclipselink as JPA providers i get
    exceptions about not serializable objects in flow scope:
    org.springframework.webflow.execution.repository.s napshot.SnapshotCreationException: Could not serialize flow execution; make sure all objects stored in flow or flash scope are serializable

    java.io.NotSerializableException: org.eclipse.persistence.internal.jpa.EntityManager Impl


    Does anyone jave a workaround for this? I tried with static and load time weaving but the result remains the same.

  • #2
    any updates on this matter ? i face the same issue too

    Comment


    • #3
      Hi,

      Looks like their Entity Manager implementation is not serializable. I would bring this up with the EclipseLink team--perhaps they have this capability factored into their feature roadmap.

      Keith

      Comment


      • #4
        tq, I really appreciate it

        I m a bit frustated yesterday, I was trying to save a web of object in one go, using Hibernate I get not serializable exception on MarkerObject, then I tried eclipse link and get the same exception on EntityManagerImpl, and after that I get problem on integrating OpenJPA, get NullPointerException on serializing and deserializing. Finally I decided to recompile Hibernate ^^, I hope the JPA Providers would help us.

        Comment


        • #5
          Hi,

          I have changed the sample application swf-booking-faces (2.0.7-RELEASE) to work with EclipseLink 1.1.0. I have deployed it on Glassfish V3 ApplicationServer. When pushing the button "Book Hotel" I get the same error.

          Does anybody know a sollution or workaround?

          Code:
          [#|2009-04-23T15:27:28.009+0200|INFO|sun-glassfish|null|_ThreadID=15;_ThreadName=Thread-3;|DEBUG: org.springframework.webflow.engine.ViewState - Entering state 'enterBookingDetails' of flow 'booking'
          |#]
          
          [#|2009-04-23T15:27:28.009+0200|INFO|sun-glassfish|null|_ThreadID=15;_ThreadName=Thread-3;|DEBUG: org.springframework.webflow.engine.impl.FlowExecutionImpl - Assigned key e1s4
          |#]
          
          [#|2009-04-23T15:27:28.009+0200|INFO|sun-glassfish|null|_ThreadID=15;_ThreadName=Thread-3;|DEBUG: org.springframework.webflow.engine.Transition - Completed transition execution.  As a result, the new state is 'enterBookingDetails' in flow 'booking'
          |#]
          
          [#|2009-04-23T15:27:28.009+0200|INFO|sun-glassfish|null|_ThreadID=15;_ThreadName=Thread-3;|DEBUG: org.springframework.webflow.execution.repository.impl.DefaultFlowExecutionRepository - Putting flow execution '[FlowExecutionImpl@fcc426 flow = 'main', flowSessions = list[[FlowSessionImpl@1f9603b flow = 'main', state = 'bookHotel', scope = map['searchCriteria' -> [Search Criteria searchString = '', 'hotel' -> Hotel(Chilworth Manor,The Cottage, Southampton Business Park,Southampton,SO16 7JF)]], [FlowSessionImpl@1bb71ac flow = 'booking', state = 'enterBookingDetails', scope = map['persistenceContext' -> org.eclipse.persistence.internal.jpa.EntityManagerImpl@124044e, 'booking' -> Booking(User(erwin),Hotel(Chilworth Manor,The Cottage, Southampton Business Park,Southampton,SO16 7JF)), 'hotelId' -> 3, 'viewScope' -> map[[empty]]]]]]' into repository
          |#]
          
          [#|2009-04-23T15:27:28.024+0200|INFO|sun-glassfish|null|_ThreadID=15;_ThreadName=Thread-3;|DEBUG: org.springframework.webflow.conversation.impl.SessionBindingConversationManager - Unlocking conversation 1
          |#]
          
          [#|2009-04-23T15:27:28.024+0200|INFO|sun-glassfish|null|_ThreadID=15;_ThreadName=Thread-3;|DEBUG: org.springframework.web.servlet.DispatcherServlet - Could not complete request
          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)
          	at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183)
          	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
          	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
          	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
          	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
          	at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
          	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
          	at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:431)
          	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:337)
          	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
          	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
          	at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
          	at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
          	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
          	at org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:67)
          	at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
          	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
          	at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
          	at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
          	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
          	at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105)
          	at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
          	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
          	at org.springframework.security.ui.rememberme.RememberMeProcessingFilter.doFilterHttp(RememberMeProcessingFilter.java:116)
          	at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
          	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
          	at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)
          	at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
          	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
          	at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:174)
          	at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
          	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
          	at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:277)
          	at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
          	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
          	at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
          	at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
          	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
          	at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
          	at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
          	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
          	at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
          	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
          	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
          	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
          	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
          	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
          	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
          	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
          	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
          	at org.apache.catalina.core.StandardWrapperValve.preInvoke(StandardWrapperValve.

          Comment


          • #6
            Did any found a resolution to this issue?

            I'm getting the same error as Fonto above

            My config:
            EclipseLink instead of Hibernate. I have tested the hibernate part and it works great

            In case of EclipseLink not sure what to do:

            EclipseLink
            Spring WebFlow 2.0.8
            Tomcat 6.0.20
            MySQL 5.1

            Caused by: java.io.NotSerializableException: org.eclipse.persistence.internal.jpa.EntityManager Impl
            at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1156)
            at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1509)
            at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1474)
            at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1392)

            Comment


            • #7
              Originally posted by Keith Donald View Post
              Hi,

              Looks like their Entity Manager implementation is not serializable. I would bring this up with the EclipseLink team--perhaps they have this capability factored into their feature roadmap.

              Keith
              Must the Entity Manager be Serializable?
              This is not a requirement of JPA spec, so I guess we cannot rely on it.

              Nicolas.

              Comment


              • #8
                Any progress

                Hi All

                Any progress on where this is going? Should Webflow expect EntityManager to be Serializable when the JPA spec does not specify that EntityManager need to be Serializable?

                Comment


                • #9
                  You should be able to disable serialization of the flow state with this:

                  Code:
                  	<webflow:flow-executor id="flowExecutor">
                  
                  		<webflow:flow-execution-repository max-execution-snapshots="0" />
                  
                  	</webflow:flow-executor>
                  Of course, that brings with it other issues...

                  Comment


                  • #10
                    Originally posted by Keith Donald View Post
                    Hi,

                    Looks like their Entity Manager implementation is not serializable. I would bring this up with the EclipseLink team--perhaps they have this capability factored into their feature roadmap.

                    Keith
                    Keith,

                    I've reported new issue into JIRA, related to this discussion - see: https://jira.springsource.org/browse/SWF-1463 - as I wrote there, the reason of this issue is wrong assumption that all implementations of EntityManager should be Serializable, while they don't have to - it has nothing to do with EclipseLink, and should be corrected in the Spring Webflow code.

                    Comment


                    • #11
                      Elaboration on workaround

                      I'm having the same issue. On the JIRA ticket, Rossen Stoyanchev said that the workaround is to "merging your flow variables with EntityManager". Can anyone elaborate on what this means?

                      Comment

                      Working...
                      X