Grails upgrade from 1.3.7 to Grails 2.1.0. Grails run-app executed. No errors.
Call to webflow action throws GrailsExceptionResolver error. States a grails webflow object isn’t serializable. I have navigated all classes to ensure all have ‘implements serializable’.
Error not identifying object not being serialized, so unable to identify if a class field should be made transient to be ignored by serializable runtime.
Full Stacktrace:
2016-12-20 09:51:25,750 [http-bio-80-exec-1] DEBUG services.RpgService - ************
| Error 2016-12-20 09:51:26,450 [http-bio-80-exec-1] ERROR errors.GrailsExceptionResolver - NotSerializableException occurred when processing request: [GET] /…/…/order
org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext. Stacktrace follows:
Message: Could not serialize flow execution; make sure all objects stored in flow or flash scope are serializable
Line | Method
->> 384 | doFilterInternal in org.jsecurity.web.servlet.JsecurityFilter
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 183 | doFilter in org.jsecurity.web.servlet.OncePerRequestFilter
| 886 | runTask . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . . . . . in java.lang.Thread
Caused by NotSerializableException: org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext
->> 1164 | writeObject0 in java.io.ObjectOutputStream
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1518 | defaultWriteFields in ''
| 1483 | writeSerialData in ''
| 1400 | writeOrdinaryObject in ''
| 1158 | writeObject0 . . in ''
| 1518 | defaultWriteFields in ''
| 1483 | writeSerialData in ''
| 1400 | writeOrdinaryObject in ''
| 1158 | writeObject0 . . in ''
| 330 | writeObject in ''
| 1001 | writeObject . . in java.util.HashMap
| 940 | invokeWriteObject in java.io.ObjectStreamClass
| 1469 | writeSerialData in java.io.ObjectOutputStream
| 1400 | writeOrdinaryObject in ''
| 1158 | writeObject0 . . in ''
| 1518 | defaultWriteFields in ''
Found the resolution. My controller service was calling sessionFactory which also needed to be transient.
code change: def sessionFactory => transient sessionFactory. Did not need make any domain class variables transient directly. fixed the issue.