{"action":"created","issue":{"url":"https://api.github.com/repos/magro/memcached-session-manager/issues/187","labels_url":"https://api.github.com/repos/magro/memcached-session-manager/issues/187/labels{/name}","comments_url":"https://api.github.com/repos/magro/memcached-session-manager/issues/187/comments","events_url":"https://api.github.com/repos/magro/memcached-session-manager/issues/187/events","html_url":"https://github.com/magro/memcached-session-manager/issues/187","id":102676270,"number":187,"title":"Deserialization fails on ConcurrentHashMap in Spring User object","user":{"login":"google-code-exporter","id":13935235,"avatar_url":"https://avatars.githubusercontent.com/u/13935235?v=3","gravatar_id":"","url":"https://api.github.com/users/google-code-exporter","html_url":"https://github.com/google-code-exporter","followers_url":"https://api.github.com/users/google-code-exporter/followers","following_url":"https://api.github.com/users/google-code-exporter/following{/other_user}","gists_url":"https://api.github.com/users/google-code-exporter/gists{/gist_id}","starred_url":"https://api.github.com/users/google-code-exporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google-code-exporter/subscriptions","organizations_url":"https://api.github.com/users/google-code-exporter/orgs","repos_url":"https://api.github.com/users/google-code-exporter/repos","events_url":"https://api.github.com/users/google-code-exporter/events{/privacy}","received_events_url":"https://api.github.com/users/google-code-exporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/magro/memcached-session-manager/labels/bug","name":"bug","color":"FFFFFF"},{"url":"https://api.github.com/repos/magro/memcached-session-manager/labels/imported","name":"imported","color":"FFFFFF"},{"url":"https://api.github.com/repos/magro/memcached-session-manager/labels/Priority-Medium","name":"Priority-Medium","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-08-24T00:21:35Z","updated_at":"2015-08-24T00:22:17Z","closed_at":null,"body":"_From [monster...@gmail.com](https://code.google.com/u/106829663774569401640/) on June 20, 2012 20:51:14_\n\n<b>What steps will reproduce the problem?</b>\n1. Try to serialize a spring User object that contains a TreeSet&#13;\n<b>2.</b>\n<b>3.</b>\n&#13;\n<b>What is the expected output? What do you see instead?</b>\n&#13;\nCorrect serialization. Stack Trace&#13;\nWARNING: Could not load session with id C85C5CD2388F9929DC99908ED6013146-n1 from memcached.&#13;\ncom.esotericsoftware.kryo.SerializationException: Unable to deserialize object of type: java.util.concurrent.ConcurrentHashMap&#13;\n\tat com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:593)&#13;\n\tat com.esotericsoftware.kryo.ObjectBuffer.readObject(ObjectBuffer.java:213)&#13;\n\tat de.javakaffee.web.msm.serializer.kryo.KryoTranscoder.deserializeAttributes(KryoTranscoder.java:256)&#13;\n\tat de.javakaffee.web.msm.TranscoderService.deserializeAttributes(TranscoderService.java:159)&#13;\n\tat de.javakaffee.web.msm.TranscoderService.deserialize(TranscoderService.java:116)&#13;\n\tat de.javakaffee.web.msm.MemcachedSessionService.loadFromMemcached(MemcachedSessionService.java:1027)&#13;\n\tat de.javakaffee.web.msm.MemcachedSessionService.findSession(MemcachedSessionService.java:578)&#13;\n\tat de.javakaffee.web.msm.MemcachedBackupSessionManager.findSession(MemcachedBackupSessionManager.java:196)&#13;\n\tat org.apache.catalina.connector.Request.doGetSession(Request.java:2841)&#13;\n\tat org.apache.catalina.connector.Request.getSession(Request.java:2307)&#13;\n\tat org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:897)&#13;\n\tat javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:229)&#13;\n\tat org.springframework.security.web.context.HttpSessionSecurityContextRepository$SaveToSessionResponseWrapper.createNewSessionIfAllowed(HttpSessionSecurityContextRepository.java:339)&#13;\n\tat org.springframework.security.web.context.HttpSessionSecurityContextRepository$SaveToSessionResponseWrapper.saveContext(HttpSessionSecurityContextRepository.java:280)&#13;\n\tat org.springframework.security.web.context.HttpSessionSecurityContextRepository.saveContext(HttpSessionSecurityContextRepository.java:104)&#13;\n\tat org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:87)&#13;\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)&#13;\n\tat org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)&#13;\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)&#13;\n\tat com.redbox.digital.proxy.security.WSFedRememberMeAuthenticationFilter.doFilter(WSFedRememberMeAuthenticationFilter.java:104)&#13;\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)&#13;\n\tat org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)&#13;\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)&#13;\n\tat org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)&#13;\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)&#13;\n\tat org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:201)&#13;\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)&#13;\n\tat com.redbox.digital.proxy.security.WSFedRequestParamPreAuthenticationFilter.doFilter(WSFedRequestParamPreAuthenticationFilter.java:195)&#13;\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)&#13;\n\tat org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)&#13;\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)&#13;\n\tat org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)&#13;\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)&#13;\n\tat org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)&#13;\n\tat org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)&#13;\n\tat org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)&#13;\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)&#13;\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)&#13;\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)&#13;\n\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)&#13;\n\tat de.javakaffee.web.msm.SessionTrackerValve.invoke(SessionTrackerValve.java:126)&#13;\n\tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)&#13;\n\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)&#13;\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)&#13;\n\tat org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)&#13;\n\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)&#13;\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)&#13;\n\tat org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)&#13;\n\tat org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)&#13;\n\tat org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)&#13;\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)&#13;\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)&#13;\n\tat java.lang.Thread.run(Thread.java:722)&#13;\nCaused by: com.esotericsoftware.kryo.SerializationException: Unable to deserialize object of type: org.springframework.security.core.context.SecurityContextImpl&#13;\n\tat com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:571)&#13;\n\tat com.esotericsoftware.kryo.serialize.MapSerializer.readObjectData(MapSerializer.java:129)&#13;\n\tat com.esotericsoftware.kryo.Serializer.readObject(Serializer.java:61)&#13;\n\tat com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:589)&#13;\n\t... 52 more&#13;\nCaused by: com.esotericsoftware.kryo.SerializationException: Serialization trace:&#13;\nauthorities (org.springframework.security.core.userdetails.User)&#13;\nprincipal (org.springframework.security.authentication.UsernamePasswordAuthenticationToken)&#13;\nauthentication (org.springframework.security.core.context.SecurityContextImpl)&#13;\n\tat com.esotericsoftware....\n\n_Original issue: http://code.google.com/p/memcached-session-manager/issues/detail?id=145_"},"comment":{"url":"https://api.github.com/repos/magro/memcached-session-manager/issues/comments/133971703","html_url":"https://github.com/magro/memcached-session-manager/issues/187#issuecomment-133971703","issue_url":"https://api.github.com/repos/magro/memcached-session-manager/issues/187","id":133971703,"user":{"login":"google-code-exporter","id":13935235,"avatar_url":"https://avatars.githubusercontent.com/u/13935235?v=3","gravatar_id":"","url":"https://api.github.com/users/google-code-exporter","html_url":"https://github.com/google-code-exporter","followers_url":"https://api.github.com/users/google-code-exporter/followers","following_url":"https://api.github.com/users/google-code-exporter/following{/other_user}","gists_url":"https://api.github.com/users/google-code-exporter/gists{/gist_id}","starred_url":"https://api.github.com/users/google-code-exporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google-code-exporter/subscriptions","organizations_url":"https://api.github.com/users/google-code-exporter/orgs","repos_url":"https://api.github.com/users/google-code-exporter/repos","events_url":"https://api.github.com/users/google-code-exporter/events{/privacy}","received_events_url":"https://api.github.com/users/google-code-exporter/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T00:22:17Z","updated_at":"2015-08-24T00:22:17Z","body":"_From [steffen...@googlemail.com](https://code.google.com/u/109403461685878006584/) on October 14, 2013 03:13:09_\n\nHello Martin,\r\n\r\nThank you for adding the update to kryo. Regarding to the fix: using type.getName().equals(TreeMap.class.getName() avoids serializing subclasses for which specific serializers might be requird. \r\n\r\nWhen using the method isAssignableFrom(mytype) for a derived TreeMap class with additional fields, serializing the additional fields would not happen, and no error would be produced. The resulting error would be quite similar to the 1.04 implementation, which made a cast of the TreeMap to a collection and missed to serialize the comparator field.\r\n\r\nDo you think this could be a problem?"}}