Thanks for pointing that out, I wasn't finishing the GZIP stream properly,
already fixed in the updated gist.
https://gist.github.com/duskote/0f8cce8d1b0d1cc56844

You could give it another try and see if it works for you.


On Thu, Mar 6, 2014 at 11:36 AM, Lidija Dolinar <lidija....@gmail.com>wrote:

> Dusko, thank you for your reply.
>
> If I use your SimplePrincipalSerializer, the rememberMe cookie is indeed
> created and is very small:
>
>
> [11:31:39] DEBUG [org.apache.shiro.web.servlet.SimpleCookie]: Added
> HttpServletResponse Cookie [rememberMe=deleteMe; Path=/; Max-Age=0;
> Expires=Wed, 05-Mar-2014 10:31:39 GMT]
> [11:31:39] DEBUG [org.apache.shiro.web.servlet.SimpleCookie]: Added
> HttpServletResponse Cookie
> [rememberMe=Kjvu3Jysio7jGf7Xew6Rp46oiHDrDC/V00ltCDbFw4M=; Path=/;
> Max-Age=1209600; Expires=Thu, 20-Mar-2014 10:31:39 GMT; HttpOnly]
>
>
>
> But I get the following exception at deserialization time (sorry for the
> ugly wrapping):
>
>
>
> [11:32:36] DEBUG [org.apache.shiro.web.servlet.SimpleCookie]: Found
> 'rememberMe' cookie value [Kjvu3Jysio7jGf7Xew6Rp46oiHDrDC/V00ltCDbFw4M=]
> [11:32:36] DEBUG [org.apache.shiro.mgt.AbstractRememberMeManager]: There
> was a failure while trying to retrieve remembered principals.  This could
> be due to a configuration problem or corrupted principals.  This could also
> be due to a recently changed encryption key.  The remembered identity will
> be forgotten and not used for this request.
> org.apache.shiro.io.SerializationException: Unexpected end of ZLIB input
> stream
> at
>
> si.najdi.web.util.SimplePrincipalSerializer2.deserialize(SimplePrincipalSerializer2.java:85)
> ~[classes/:na]
> at
>
> si.najdi.web.util.SimplePrincipalSerializer2.deserialize(SimplePrincipalSerializer2.java:17)
> ~[classes/:na]
> at
>
> org.apache.shiro.mgt.AbstractRememberMeManager.deserialize(AbstractRememberMeManager.java:514)
> ~[shiro-core-1.2.0.jar:1.2.0]
> at
>
> org.apache.shiro.mgt.AbstractRememberMeManager.convertBytesToPrincipals(AbstractRememberMeManager.java:431)
> ~[shiro-core-1.2.0.jar:1.2.0]
> at
>
> org.apache.shiro.mgt.AbstractRememberMeManager.getRememberedPrincipals(AbstractRememberMeManager.java:396)
> ~[shiro-core-1.2.0.jar:1.2.0]
> at
>
> org.apache.shiro.mgt.DefaultSecurityManager.getRememberedIdentity(DefaultSecurityManager.java:604)
> [shiro-core-1.2.0.jar:1.2.0]
> at
>
> org.apache.shiro.mgt.DefaultSecurityManager.resolvePrincipals(DefaultSecurityManager.java:492)
> [shiro-core-1.2.0.jar:1.2.0]
> at
>
> org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:342)
> [shiro-core-1.2.0.jar:1.2.0]
> at $WebSecurityManager_439fe43247936.createSubject(Unknown Source) [na:na]
> at org.apache.shiro.subject.Subject$Builder.buildSubject(Subject.java:846)
> [shiro-core-1.2.0.jar:1.2.0]
> at
>
> org.apache.shiro.web.subject.WebSubject$Builder.buildWebSubject(WebSubject.java:148)
> [shiro-web-1.2.0.jar:1.2.0]
> at
>
> org.tynamo.security.services.impl.SecurityConfiguration.service(SecurityConfiguration.java:51)
> [tapestry-security-0.5.1.jar:0.5.1]
> at $HttpServletRequestFilter_439fe43247931.service(Unknown Source) [na:na]
> at $HttpServletRequestHandler_439fe43247934.service(Unknown Source) [na:na]
> at
>
> org.got5.tapestry5.jquery.services.AjaxUploadServletRequestFilter.service(AjaxUploadServletRequestFilter.java:26)
> [tapestry5-jquery-3.3.3.jar:na]
> at $HttpServletRequestHandler_439fe43247934.service(Unknown Source) [na:na]
> at
>
> org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:44)
> [tapestry-upload-5.3.7.jar:na]
> at $HttpServletRequestHandler_439fe43247934.service(Unknown Source) [na:na]
> at
>
> org.tynamo.resteasy.ResteasyRequestFilter.service(ResteasyRequestFilter.java:100)
> [tapestry-resteasy-0.3.1.jar:0.3.1]
> at $HttpServletRequestFilter_439fe4324792e.service(Unknown Source) [na:na]
> at $HttpServletRequestHandler_439fe43247934.service(Unknown Source) [na:na]
> at
>
> org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
> [tapestry-core-5.3.7.jar:na]
> at $HttpServletRequestFilter_439fe4324792c.service(Unknown Source) [na:na]
> at $HttpServletRequestHandler_439fe43247934.service(Unknown Source) [na:na]
> at
>
> org.apache.tapestry5.services.TapestryModule$1.service(TapestryModule.java:852)
> [tapestry-core-5.3.7.jar:na]
> at $HttpServletRequestHandler_439fe43247934.service(Unknown Source) [na:na]
> at $HttpServletRequestHandler_439fe4324792b.service(Unknown Source) [na:na]
> at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:171)
> [tapestry-core-5.3.7.jar:na]
> at
>
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
> [jetty-servlet-8.1.9.v20130131.jar:8.1.9.v20130131]
> at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206)
> [javamelody-core-1.43.0.jar:1.43.0]
> at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179)
> [javamelody-core-1.43.0.jar:1.43.0]
> at
>
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
> [jetty-servlet-8.1.9.v20130131.jar:8.1.9.v20130131]
> at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:598)
> [hazelcast-wm-2.5.jar:2.5]
> at
>
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
> [jetty-servlet-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
> [jetty-servlet-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
> [jetty-security-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
> [jetty-servlet-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at org.eclipse.jetty.server.Server.handle(Server.java:368)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:488)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:932)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:994)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)
> [jetty-http-8.1.9.v20130131.jar:8.1.9.v20130131]
> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
> [jetty-http-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
> [jetty-io-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
> [jetty-io-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
> [jetty-util-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
> [jetty-util-8.1.9.v20130131.jar:8.1.9.v20130131]
> at java.lang.Thread.run(Thread.java:662) [na:1.6.0_43]
> [11:32:36] DEBUG [org.apache.shiro.web.servlet.SimpleCookie]: Added
> HttpServletResponse Cookie [rememberMe=deleteMe; Path=/; Max-Age=0;
> Expires=Wed, 05-Mar-2014 10:32:36 GMT]
> [11:32:36] WARN  [org.apache.shiro.mgt.DefaultSecurityManager]: Delegate
> RememberMeManager instance of type
> [si.najdi.web.services.NajdiCookieRememberMeManager] threw an exception
> during getRememberedPrincipals().
> org.apache.shiro.io.SerializationException: Unexpected end of ZLIB input
> stream
> at
>
> si.najdi.web.util.SimplePrincipalSerializer2.deserialize(SimplePrincipalSerializer2.java:85)
> ~[classes/:na]
> at
>
> si.najdi.web.util.SimplePrincipalSerializer2.deserialize(SimplePrincipalSerializer2.java:17)
> ~[classes/:na]
> at
>
> org.apache.shiro.mgt.AbstractRememberMeManager.deserialize(AbstractRememberMeManager.java:514)
> ~[shiro-core-1.2.0.jar:1.2.0]
> at
>
> org.apache.shiro.mgt.AbstractRememberMeManager.convertBytesToPrincipals(AbstractRememberMeManager.java:431)
> ~[shiro-core-1.2.0.jar:1.2.0]
> at
>
> org.apache.shiro.mgt.AbstractRememberMeManager.getRememberedPrincipals(AbstractRememberMeManager.java:396)
> ~[shiro-core-1.2.0.jar:1.2.0]
> at
>
> org.apache.shiro.mgt.DefaultSecurityManager.getRememberedIdentity(DefaultSecurityManager.java:604)
> [shiro-core-1.2.0.jar:1.2.0]
> at
>
> org.apache.shiro.mgt.DefaultSecurityManager.resolvePrincipals(DefaultSecurityManager.java:492)
> [shiro-core-1.2.0.jar:1.2.0]
> at
>
> org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:342)
> [shiro-core-1.2.0.jar:1.2.0]
> at $WebSecurityManager_439fe43247936.createSubject(Unknown Source) [na:na]
> at org.apache.shiro.subject.Subject$Builder.buildSubject(Subject.java:846)
> [shiro-core-1.2.0.jar:1.2.0]
> at
>
> org.apache.shiro.web.subject.WebSubject$Builder.buildWebSubject(WebSubject.java:148)
> [shiro-web-1.2.0.jar:1.2.0]
> at
>
> org.tynamo.security.services.impl.SecurityConfiguration.service(SecurityConfiguration.java:51)
> [tapestry-security-0.5.1.jar:0.5.1]
> at $HttpServletRequestFilter_439fe43247931.service(Unknown Source) [na:na]
> at $HttpServletRequestHandler_439fe43247934.service(Unknown Source) [na:na]
> at
>
> org.got5.tapestry5.jquery.services.AjaxUploadServletRequestFilter.service(AjaxUploadServletRequestFilter.java:26)
> [tapestry5-jquery-3.3.3.jar:na]
> at $HttpServletRequestHandler_439fe43247934.service(Unknown Source) [na:na]
> at
>
> org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:44)
> [tapestry-upload-5.3.7.jar:na]
> at $HttpServletRequestHandler_439fe43247934.service(Unknown Source) [na:na]
> at
>
> org.tynamo.resteasy.ResteasyRequestFilter.service(ResteasyRequestFilter.java:100)
> [tapestry-resteasy-0.3.1.jar:0.3.1]
> at $HttpServletRequestFilter_439fe4324792e.service(Unknown Source) [na:na]
> at $HttpServletRequestHandler_439fe43247934.service(Unknown Source) [na:na]
> at
>
> org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
> [tapestry-core-5.3.7.jar:na]
> at $HttpServletRequestFilter_439fe4324792c.service(Unknown Source) [na:na]
> at $HttpServletRequestHandler_439fe43247934.service(Unknown Source) [na:na]
> at
>
> org.apache.tapestry5.services.TapestryModule$1.service(TapestryModule.java:852)
> [tapestry-core-5.3.7.jar:na]
> at $HttpServletRequestHandler_439fe43247934.service(Unknown Source) [na:na]
> at $HttpServletRequestHandler_439fe4324792b.service(Unknown Source) [na:na]
> at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:171)
> [tapestry-core-5.3.7.jar:na]
> at
>
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
> [jetty-servlet-8.1.9.v20130131.jar:8.1.9.v20130131]
> at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206)
> [javamelody-core-1.43.0.jar:1.43.0]
> at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179)
> [javamelody-core-1.43.0.jar:1.43.0]
> at
>
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
> [jetty-servlet-8.1.9.v20130131.jar:8.1.9.v20130131]
> at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:598)
> [hazelcast-wm-2.5.jar:2.5]
> at
>
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
> [jetty-servlet-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
> [jetty-servlet-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
> [jetty-security-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
> [jetty-servlet-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at org.eclipse.jetty.server.Server.handle(Server.java:368)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:488)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:932)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:994)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)
> [jetty-http-8.1.9.v20130131.jar:8.1.9.v20130131]
> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
> [jetty-http-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
> [jetty-server-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
> [jetty-io-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
> [jetty-io-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
> [jetty-util-8.1.9.v20130131.jar:8.1.9.v20130131]
> at
>
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
> [jetty-util-8.1.9.v20130131.jar:8.1.9.v20130131]
> at java.lang.Thread.run(Thread.java:662) [na:1.6.0_43]
>
>
>
> Regards,
> Lidija
>
>
>
> On Thu, Mar 6, 2014 at 11:14 AM, Dusko Jovanovski <dusk...@gmail.com>
> wrote:
>
> > Hello Lidija, could you try out this custom serializer and report back
> with
> > the results?
> >
> > https://gist.github.com/duskote/0f8cce8d1b0d1cc56844
> >
> >
> >
>

Reply via email to