PDA

View Full Version : FlowExecutionStorageException



akw
Jul 15th, 2005, 07:10 PM
I'm a bit perplexed about this exception. The class that cannot be found is on the classpath, and is referenced many times during execution prior to this exception being thrown. Does anyone have any ideas?



org.springframework.web.flow.execution.FlowExecuti onStorageException: ClassNotFoundException loading the flow execution continuation -- this should not happen!; nested exception is java.lang.ClassNotFoundException: com.mycompany.domain.type.CustomType
java.lang.ClassNotFoundException: com.mycompany.domain.type.CustomType
at java.net.URLClassLoader$1.run(URLClassLoader.java: 199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 89)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 35)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at java.io.ObjectInputStream.resolveClass(ObjectInput Stream.java:558)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:1513)
at java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1626)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:324)
at java.util.HashMap.readObject(HashMap.java:1006)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeReadObject(ObjectS treamClass.java:838)
at java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1746)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(Object InputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:324)
at org.springframework.web.flow.execution.impl.FlowSe ssionImpl.readObject(FlowSessionImpl.java:161)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeReadObject(ObjectS treamClass.java:838)
at java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1746)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1274)
at java.io.ObjectInputStream.readArray(ObjectInputStr eam.java:1603)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1271)
at java.io.ObjectInputStream.defaultReadFields(Object InputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:324)
at org.springframework.web.flow.execution.impl.FlowEx ecutionImpl.readObject(FlowExecutionImpl.java:445)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeReadObject(ObjectS treamClass.java:838)
at java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1746)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:324)
at org.springframework.web.flow.execution.FlowExecuti onContinuation.getFlowExecution(FlowExecutionConti nuation.java:99)
at org.springframework.web.flow.execution.servlet.Htt pSessionContinuationFlowExecutionStorage.load(Http SessionContinuationFlowExecutionStorage.java:66)
at org.springframework.web.flow.execution.FlowExecuti onManager.onEvent(FlowExecutionManager.java:272)
at org.springframework.web.flow.execution.FlowExecuti onManager.onEvent(FlowExecutionManager.java:245)
at org.springframework.web.flow.execution.servlet.Ser vletFlowExecutionManager.handle(ServletFlowExecuti onManager.java:77)
at org.springframework.web.flow.mvc.FlowController.ha ndleRequestInternal(FlowController.java:137)
at org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:128)
at org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:44)
at org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:684)
at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:625)
at org.springframework.web.servlet.FrameworkServlet.s erviceWrapper(FrameworkServlet.java:386)
at org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:355)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.mortbay.jetty.servlet.ServletHolder.handle(Ser vletHolder.java:358)
at org.mortbay.jetty.servlet.WebApplicationHandler$Ch ain.doFilter(WebApplicationHandler.java:342)
at net.sf.acegisecurity.util.FilterChainProxy.doFilte r(FilterChainProxy.java:167)
at net.sf.acegisecurity.util.FilterToBeanProxy.doFilt er(FilterToBeanProxy.java:125)
at org.mortbay.jetty.servlet.WebApplicationHandler$Ch ain.doFilter(WebApplicationHandler.java:334)
at org.mortbay.jetty.servlet.WebApplicationHandler.di spatch(WebApplicationHandler.java:286)
at org.mortbay.jetty.servlet.ServletHandler.handle(Se rvletHandler.java:567)
at org.mortbay.http.HttpContext.handle(HttpContext.ja va:1807)
at org.mortbay.jetty.servlet.WebApplicationContext.ha ndle(WebApplicationContext.java:525)
at org.mortbay.http.HttpContext.handle(HttpContext.ja va:1757)
at org.mortbay.jetty.plus.PlusWebAppContext.handle(Pl usWebAppContext.java:218)
at org.mortbay.http.HttpServer.service(HttpServer.jav a:879)
at org.mortbay.http.HttpConnection.service(HttpConnec tion.java:790)
at org.mortbay.http.HttpConnection.handleNext(HttpCon nection.java:961)
at org.mortbay.http.HttpConnection.handle(HttpConnect ion.java:807)
at org.mortbay.http.SocketListener.handleConnection(S ocketListener.java:218)
at org.mortbay.util.ThreadedServer.handle(ThreadedSer ver.java:300)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadP ool.java:511)

Keith Donald
Jul 16th, 2005, 05:35 AM
Is this happening in your app or one of the samples?

Have you ever seen that class before???? I admit it does look suspsciously like one of my sample class names (com.mycompany.domain anyway), but I have no idea where it could be coming from.

What do you mean the class is referenced many times before the exception is thrown?

akw
Jul 16th, 2005, 03:43 PM
This exception was being thrown in my own application, not one of the samples.

As it turns out, the root cause of this was the way that I had my servlet container configured. The DispatcherServlet was being loaded by the servlet container's parent classloader, while the class that could not be found was being loaded by the webapp context's classloader. Since the webapp context's classloader is a child of the servlet container's classloader, any attempt to load CustomType from the DispatcherServlet failed.

The solution is to put the spring jar either in WEB-INF/lib or to put my application classes on the system classpath rather than in WEB-INF/classes.

Thanks for following up, Keith!

klr8
Jul 20th, 2005, 08:10 AM
Thanks for providing this insight. I added some extra info to the exception that is thrown to hint at your analysis. That will help if someone else encounters the issue.

Erwin