spring - Java deserialzation throwing ClassCastException in Jetty server -
i'm using java object serialization transfer pojo spring controller. working fine in tomcat when deploy in jetty server throwing following exception.
i've tried 2 approaches, plain objectoutputstream , apache commons-lang3 serializationutils both throwing same exception. looks missing jetty.
jetty versions:
9.2.11.v20150529
9.2.10.v20150310
java.lang.classcastexception: sun.reflect.generatedserializationconstructoraccessor5 cannot cast sun.reflect.serializationconstructoraccessorimpl @ sun.reflect.methodaccessorgenerator.generateserializationconstructor(methodaccessorgenerator.java:112) @ sun.reflect.reflectionfactory.newconstructorforserialization(reflectionfactory.java:340) @ java.io.objectstreamclass.getserializableconstructor(objectstreamclass.java:1420) @ java.io.objectstreamclass.access$1500(objectstreamclass.java:72) @ java.io.objectstreamclass$2.run(objectstreamclass.java:497) @ java.io.objectstreamclass$2.run(objectstreamclass.java:472) @ java.security.accesscontroller.doprivileged(native method) @ java.io.objectstreamclass.<init>(objectstreamclass.java:472) @ java.io.objectstreamclass.lookup(objectstreamclass.java:369) @ java.io.objectstreamclass.initnonproxy(objectstreamclass.java:598) @ java.io.objectinputstream.readnonproxydesc(objectinputstream.java:1623) @ java.io.objectinputstream.readclassdesc(objectinputstream.java:1518) @ java.io.objectinputstream.readordinaryobject(objectinputstream.java:1774) @ java.io.objectinputstream.readobject0(objectinputstream.java:1351) @ java.io.objectinputstream.readobject(objectinputstream.java:371) @ com.abc.gw.common.utils.deserialize(utils.java:14) @ com.abc.gw.service.qcontroller.forward(qcontroller.java:38) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:497) @ org.springframework.web.method.support.invocablehandlermethod.doinvoke(invocablehandlermethod.java:221) @ org.springframework.web.method.support.invocablehandlermethod.invokeforrequest(invocablehandlermethod.java:137) @ org.springframework.web.servlet.mvc.method.annotation.servletinvocablehandlermethod.invokeandhandle(servletinvocablehandlermethod.java:110) @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.invokehandlemethod(requestmappinghandleradapter.java:776) @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.handleinternal(requestmappinghandleradapter.java:705) @ org.springframework.web.servlet.mvc.method.abstracthandlermethodadapter.handle(abstracthandlermethodadapter.java:85) @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:959) @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:893) @ org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:966) @ org.springframework.web.servlet.frameworkservlet.dopost(frameworkservlet.java:868) @ javax.servlet.http.httpservlet.service(httpservlet.java:707) @ org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:842) @ javax.servlet.http.httpservlet.service(httpservlet.java:790) @ org.eclipse.jetty.servlet.servletholder.handle(servletholder.java:808) @ org.eclipse.jetty.servlet.servlethandler.dohandle(servlethandler.java:587) @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:143) @ org.eclipse.jetty.security.securityhandler.handle(securityhandler.java:577) @ org.eclipse.jetty.server.session.sessionhandler.dohandle(sessionhandler.java:223) @ org.eclipse.jetty.server.handler.contexthandler.dohandle(contexthandler.java:1127) @ org.eclipse.jetty.servlet.servlethandler.doscope(servlethandler.java:515) @ org.eclipse.jetty.server.session.sessionhandler.doscope(sessionhandler.java:185) @ org.eclipse.jetty.server.handler.contexthandler.doscope(contexthandler.java:1061) @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:141) @ org.eclipse.jetty.server.handler.contexthandlercollection.handle(contexthandlercollection.java:215) @ org.eclipse.jetty.server.handler.handlercollection.handle(handlercollection.java:110) @ org.eclipse.jetty.server.handler.handlerwrapper.handle(handlerwrapper.java:97) @ org.eclipse.jetty.server.server.handle(server.java:499) @ org.eclipse.jetty.server.httpchannel.handle(httpchannel.java:310) @ org.eclipse.jetty.server.httpconnection.onfillable(httpconnection.java:257) @ org.eclipse.jetty.io.abstractconnection$2.run(abstractconnection.java:540) @ org.eclipse.jetty.util.thread.queuedthreadpool.runjob(queuedthreadpool.java:635) @ org.eclipse.jetty.util.thread.queuedthreadpool$3.run(queuedthreadpool.java:555) @ java.lang.thread.run(thread.java:745)
Comments
Post a Comment