View Full Version : EclipseLink, Toplink NotSerializableException
jmekman
Aug 28th, 2008, 12:38 PM
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.
andre80
Sep 23rd, 2008, 04:38 AM
any updates on this matter ? i face the same issue too
Keith Donald
Sep 23rd, 2008, 09:15 AM
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
andre80
Sep 23rd, 2008, 09:55 PM
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.
Fonto
Apr 23rd, 2009, 09:12 AM
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?
[#|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.FlowExecut ionImpl - 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.i mpl.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.EntityManager Impl@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.Sess ionBindingConversationManager - 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.s napshot.SnapshotCreationException: Could not serialize flow execution; make sure all objects stored in flow or flash scope are serializable
at org.springframework.webflow.execution.repository.s napshot.SerializedFlowExecutionSnapshot.<init>(SerializedFlowExecutionSnapshot.java:74)
at org.springframework.webflow.execution.repository.s napshot.SerializedFlowExecutionSnapshotFactory.cre ateSnapshot(SerializedFlowExecutionSnapshotFactory .java:70)
at org.springframework.webflow.execution.repository.s napshot.AbstractSnapshottingFlowExecutionRepositor y.snapshot(AbstractSnapshottingFlowExecutionReposi tory.java:75)
at org.springframework.webflow.execution.repository.i mpl.DefaultFlowExecutionRepository.putFlowExecutio n(DefaultFlowExecutionRepository.java:123)
at org.springframework.webflow.executor.FlowExecutorI mpl.resumeExecution(FlowExecutorImpl.java:165)
at org.springframework.webflow.mvc.servlet.FlowHandle rAdapter.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.p rocessRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.d oPost(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.se rvletService(ApplicationFilterChain.java:431)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:337)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:218)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :378)
at org.springframework.security.intercept.web.FilterS ecurityInterceptor.invoke(FilterSecurityIntercepto r.java:109)
at org.springframework.security.intercept.web.FilterS ecurityInterceptor.doFilter(FilterSecurityIntercep tor.java:83)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :390)
at org.springframework.security.ui.SessionFixationPro tectionFilter.doFilterHttp(SessionFixationProtecti onFilter.java:67)
at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :390)
at org.springframework.security.ui.ExceptionTranslati onFilter.doFilterHttp(ExceptionTranslationFilter.j ava:101)
at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :390)
at org.springframework.security.providers.anonymous.A nonymousProcessingFilter.doFilterHttp(AnonymousPro cessingFilter.java:105)
at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :390)
at org.springframework.security.ui.rememberme.Remembe rMeProcessingFilter.doFilterHttp(RememberMeProcess ingFilter.java:116)
at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :390)
at org.springframework.security.wrapper.SecurityConte xtHolderAwareRequestFilter.doFilterHttp(SecurityCo ntextHolderAwareRequestFilter.java:91)
at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :390)
at org.springframework.security.ui.basicauth.BasicPro cessingFilter.doFilterHttp(BasicProcessingFilter.j ava:174)
at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :390)
at org.springframework.security.ui.AbstractProcessing Filter.doFilterHttp(AbstractProcessingFilter.java: 277)
at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :390)
at org.springframework.security.ui.logout.LogoutFilte r.doFilterHttp(LogoutFilter.java:89)
at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :390)
at org.springframework.security.context.HttpSessionCo ntextIntegrationFilter.doFilterHttp(HttpSessionCon textIntegrationFilter.java:235)
at org.springframework.security.ui.SpringSecurityFilt er.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.DelegatingFilterPro xy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.DelegatingFilterPro xy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:250)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:218)
at org.springframework.web.filter.CharacterEncodingFi lter.doFilterInternal(CharacterEncodingFilter.java :96)
at org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:250)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:218)
at org.apache.catalina.core.StandardWrapperValve.preI nvoke(StandardWrapperValve.
sashe
Sep 15th, 2009, 02:36 AM
I'm getting the same error as Fonto above :mad:
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)
:mad:
Nicolas
Sep 17th, 2009, 02:21 AM
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.
moktc
Oct 6th, 2009, 02:45 AM
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?
cgs
Jan 2nd, 2010, 03:54 PM
You should be able to disable serialization of the flow state with this:
<webflow:flow-executor id="flowExecutor">
<webflow:flow-execution-repository max-execution-snapshots="0" />
</webflow:flow-executor>
Of course, that brings with it other issues...
vardlokkur
Mar 17th, 2011, 03:07 AM
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.
jaredp
Apr 20th, 2011, 03:16 PM
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?
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.