jcoleman / tomcat-redis-session-manager

Redis-backed non-sticky session store for Apache Tomcat
MIT License
1.8k stars 1.12k forks source link

SEVERE: Unable to deserialize into session #78

Open huangchu opened 8 years ago

huangchu commented 8 years ago

java.lang.ClassNotFoundException: com.jiuying.user.entity.logic.JydUserLogic at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:266) at org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObjectInputStream.java:74) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1593) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1514) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1619) at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1084) at com.orangefunction.tomcat.redissessions.RedisSession.readObjectData(RedisSession.java:119) at com.orangefunction.tomcat.redissessions.JavaSerializer.deserializeInto(JavaSerializer.java:76) at com.orangefunction.tomcat.redissessions.RedisSessionManager.sessionFromSerializedData(RedisSessionManager.java:530) at com.orangefunction.tomcat.redissessions.RedisSessionManager.findSession(RedisSessionManager.java:432) at org.apache.catalina.connector.Request.doGetSession(Request.java:2913) at org.apache.catalina.connector.Request.getSessionInternal(Request.java:2531) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:426) at com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve.invoke(RedisSessionHandlerValve.java:22) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1736) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1695) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

tpietsch commented 8 years ago

might need to "implement serializable" interface

zhiliangz commented 8 years ago

same question , spring security DefaultSavedRequest extends SavedRequest.
the interface SavedRequest extends serializable already. I don't know much about tomcat source code

SEVERE: Unable to deserialize into session java.lang.ClassNotFoundException: org.springframework.security.web.savedrequest.DefaultSavedRequest at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1713) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObjectInputStream.java:76) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1593) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1514) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1595) at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1060) at com.orangefunction.tomcat.redissessions.RedisSession.readObjectData(RedisSession.java:116) at com.orangefunction.tomcat.redissessions.JavaSerializer.deserializeInto(JavaSerializer.java:78) at com.orangefunction.tomcat.redissessions.RedisSessionManager.sessionFromSerializedData(RedisSessionManager.java:534) at com.orangefunction.tomcat.redissessions.RedisSessionManager.findSession(RedisSessionManager.java:436) at org.apache.catalina.connector.Request.doGetSession(Request.java:2859) at org.apache.catalina.connector.Request.getSessionInternal(Request.java:2515) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:427) at com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve.invoke(RedisSessionHandlerValve.java:26) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722)

tpietsch commented 8 years ago

@zhiliangz this exception isn't complaining about the servlet. The servlet is just in the request filter chain so the its just showing the exception propagate up through the servlet filter chain. You are probably storing an object in session at some point in your code that is not serializabe.

madepabloc commented 6 years ago

I have the same problem, @huangchu @zhiliangz did you find the solution for that?

vvbeck commented 5 years ago

two war or other 'context' in tomcat server.xml,when request 'other one' ,the redis try load session Object from 'other one' . then throw Exception.

wks0246 commented 4 years ago

I have the same problem

wks0246 commented 4 years ago

In tomcat7 environment, request. getSession() get the object then throw deserialize Exception. i find it was found the class of tomcat7 / lib instead of the class webapps / xxx ,so class not found. how to use? is config error? but get the String type is ok.

I have the same problem