New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ClientAuthorizations serializable otherwise redis will fail to save it into cache. #924

Closed
yuriyz opened this Issue Oct 15, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@yuriyz
Contributor

yuriyz commented Oct 15, 2018

org.xdi.oxauth.model.ldap.ClientAuthorizations must be serializable otherwise redis will not be able to serialize it.
https://support.gluu.org/access-management/6129/authorizing-a-client-fails/

2018-10-15 07:38:21,395 ERROR [qtp804611486-5173] [org.xdi.oxauth.exception.GlobalExceptionHandler] (GlobalExceptionHandler.java:45) - #{authorizeAction.permissionGranted}: java.lang.ClassCastException: org.xdi.oxauth.model.ldap.ClientAuthorizations cannot be cast to java.io.Serializable
javax.faces.FacesException: #{authorizeAction.permissionGranted}: java.lang.ClassCastException: org.xdi.oxauth.model.ldap.ClientAuthorizations cannot be cast to java.io.Serializable
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:89) ~[javax.faces-2.2.16.jar:2.2.16]
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [javax.faces-2.2.16.jar:2.2.16]
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) [javax.faces-2.2.16.jar:2.2.16]
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658) [javax.faces-2.2.16.jar:2.2.16]
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:215) [websocket-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.xdi.oxauth.audit.debug.ServletLoggingFilter.doFilter(ServletLoggingFilter.java:55) [classes/:?]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1634) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [jetty-security-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.server.Server.handle(Server.java:503) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305) [jetty-io-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [jetty-io-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118) [jetty-io-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) [jetty-util-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) [jetty-util-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) [jetty-util-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) [jetty-util-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) [jetty-util-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765) [jetty-util-9.4.12.v20180830.jar:9.4.12.v20180830]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683) [jetty-util-9.4.12.v20180830.jar:9.4.12.v20180830]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
Caused by: javax.faces.FacesException: #{authorizeAction.permissionGranted}: java.lang.ClassCastException: org.xdi.oxauth.model.ldap.ClientAuthorizations cannot be cast to java.io.Serializable
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118) ~[javax.faces-2.2.16.jar:2.2.16]
        at javax.faces.component.UICommand.broadcast(UICommand.java:315) ~[javax.faces-2.2.16.jar:2.2.16]
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790) ~[javax.faces-2.2.16.jar:2.2.16]
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282) ~[javax.faces-2.2.16.jar:2.2.16]
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) ~[javax.faces-2.2.16.jar:2.2.16]
        ... 40 more
Caused by: javax.faces.el.EvaluationException: java.lang.ClassCastException: org.xdi.oxauth.model.ldap.ClientAuthorizations cannot be cast to java.io.Serializable
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101) ~[javax.faces-2.2.16.jar:2.2.16]
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) ~[javax.faces-2.2.16.jar:2.2.16]
        at javax.faces.component.UICommand.broadcast(UICommand.java:315) ~[javax.faces-2.2.16.jar:2.2.16]
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790) ~[javax.faces-2.2.16.jar:2.2.16]
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282) ~[javax.faces-2.2.16.jar:2.2.16]
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) ~[javax.faces-2.2.16.jar:2.2.16]
        ... 40 more
Caused by: java.lang.ClassCastException: org.xdi.oxauth.model.ldap.ClientAuthorizations cannot be cast to java.io.Serializable
        at org.xdi.service.cache.RedisStandaloneProvider.put(RedisStandaloneProvider.java:96) ~[oxcore-service-3.1.4.Final.jar:?]
        at org.xdi.service.cache.RedisProvider.put(RedisProvider.java:71) ~[oxcore-service-3.1.4.Final.jar:?]
        at org.xdi.service.cache.CacheProvider$Proxy$_$$_WeldClientProxy.put(Unknown Source) ~[oxcore-service-3.1.4.Final.jar:?]
        at org.xdi.service.CacheService.put(CacheService.java:45) ~[oxcore-service-3.1.4.Final.jar:?]
        at org.xdi.service.CacheService.put(CacheService.java:50) ~[oxcore-service-3.1.4.Final.jar:?]
        at org.xdi.service.CacheService$Proxy$_$$_WeldClientProxy.put(Unknown Source) ~[oxcore-service-3.1.4.Final.jar:?]
        at org.xdi.oxauth.service.ClientAuthorizationsService.add(ClientAuthorizationsService.java:129) ~[classes/:?]
        at org.xdi.oxauth.service.AuthorizeService.permissionGranted(AuthorizeService.java:160) ~[classes/:?]
        at org.xdi.oxauth.authorize.ws.rs.AuthorizeAction.permissionGranted(AuthorizeAction.java:720) ~[classes/:?]
        at org.xdi.oxauth.authorize.ws.rs.AuthorizeAction.permissionGranted(AuthorizeAction.java:715) ~[classes/:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
        at org.apache.el.parser.AstValue.invoke(AstValue.java:247) ~[org.mortbay.jasper.apache-el-8.5.24.2.jar:8.5.24]
        at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:267) ~[org.mortbay.jasper.apache-el-8.5.24.2.jar:8.5.24]
        at org.jboss.weld.module.web.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) ~[weld-web-3.0.5.Final.jar:3.0.5.Final]
        at org.jboss.weld.module.web.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) ~[weld-web-3.0.5.Final.jar:3.0.5.Final]
        at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) ~[javax.faces-2.2.16.jar:2.2.16]

@yuriyz yuriyz added this to the 3.1.5 milestone Oct 15, 2018

@yuriyz yuriyz self-assigned this Oct 15, 2018

yuriyz added a commit that referenced this issue Oct 15, 2018

yuriyz added a commit that referenced this issue Oct 15, 2018

#924 (4.0) : made ClientAuthorizations serializable (otherwise it wil…
…l not work with redis)

#924

(cherry picked from commit 143b892)
@yuriyz

This comment has been minimized.

Contributor

yuriyz commented Oct 15, 2018

fixed in 3.1.5 and 4.0

@yuriyz yuriyz closed this Oct 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment