2 Replies Latest reply on Jan 2, 2019 11:16 AM by Mark McGregor

    Session replication problems with WF15 / eleytron / keycloak

    Mark McGregor Newbie

      I'm unable to get basic session replication working on WF 15.

       

      Pretty standard setup -- 2 nodes running WF 15 with eleytron security, using keycloak for SSO.   Keycloak is running on a different server.   Jgroups is setup with TCP based replication.   I've installed the keycloak 3.4.3 eleytron add-on.  The reason I'm using the 3.4.3 keycloak add-on is because that is the KC server version that we're using, and I'm not in a position to upgrade the KC server to a newer version.

       

      Everything works fine with a non distributable app.   I can see jgroups startup just fine and the 2 boxes talking to each other.    I can log in with keycloak sso, etc.   As soon as I add "<distributable/>" to the web.xml things crap out with the following exception:

       

      [2018-12-29 07:20:32,508] [ERROR] [http-io-worker task-2(io.undertow.request)] UT005023: Exception handling request to /: java.lang.IllegalArgumentException: org.infinispan.commons.marshall.NotSerializableException: org.keycloak.adapters.elytron.ElytronAccount

              at org.wildfly.clustering.web.infinispan.session.coarse.CoarseSessionAttributes.setAttribute(CoarseSessionAttributes.java:71)

              at org.wildfly.clustering.web.undertow.session.DistributableSession.setAttribute(DistributableSession.java:173)

              at io.undertow.servlet.spec.HttpSessionImpl.setAttribute(HttpSessionImpl.java:169)

              at org.wildfly.elytron.web.undertow.server.servlet.ElytronHttpServletExchange$3.setAttachment(ElytronHttpServletExchange.java:240)

              at org.keycloak.adapters.elytron.ElytronSessionTokenStore.saveAccountInfo(ElytronSessionTokenStore.java:136)

              at org.keycloak.adapters.elytron.ElytronHttpFacade.authenticationComplete(ElytronHttpFacade.java:89)

              at org.keycloak.adapters.elytron.ElytronRequestAuthenticator.completeOAuthAuthentication(ElytronRequestAuthenticator.java:62)

              at org.keycloak.adapters.RequestAuthenticator.completeAuthentication(RequestAuthenticator.java:218)

              at org.keycloak.adapters.RequestAuthenticator.authenticate(RequestAuthenticator.java:151)

              at org.keycloak.adapters.elytron.ElytronRequestAuthenticator.authenticate(ElytronRequestAuthenticator.java:44)

              at org.keycloak.adapters.elytron.KeycloakHttpServerAuthenticationMechanism.evaluateRequest(KeycloakHttpServerAuthenticationMechanism.java:96)

              at org.wildfly.security.http.util.SetMechanismInformationMechanismFactory$1.evaluateRequest(SetMechanismInformationMechanismFactory.java:119)

              at org.wildfly.security.http.util.SecurityIdentityServerMechanismFactory$1.evaluateRequest(SecurityIdentityServerMechanismFactory.java:84)

              at org.wildfly.security.http.HttpAuthenticator$AuthenticationExchange.authenticate(HttpAuthenticator.java:232)

              at org.wildfly.security.http.HttpAuthenticator$AuthenticationExchange.access$800(HttpAuthenticator.java:211)

              at org.wildfly.security.http.HttpAuthenticator.authenticate(HttpAuthenticator.java:95)

              at org.wildfly.elytron.web.undertow.server.SecurityContextImpl.authenticate(SecurityContextImpl.java:96)

              at org.wildfly.elytron.web.undertow.server.servlet.ServletSecurityContextImpl.authenticate(ServletSecurityContextImpl.java:114)

              at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:55)

              at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:53)

              at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

              at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

              at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:59)

              at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

              at org.wildfly.elytron.web.undertow.server.servlet.CleanUpHandler.handleRequest(CleanUpHandler.java:38)

              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

              at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

              at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)

              at org.keycloak.adapters.undertow.ServletPreAuthActionsHandler.handleRequest(ServletPreAuthActionsHandler.java:69)

              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

              at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)

              at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)

              at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)

              at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)

              at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)

              at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)

              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)

              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)

              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)

              at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)

              at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)

              at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)

              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)

              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)

              at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)

              at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)

              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)

              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)

              at java.lang.Thread.run(Thread.java:745)

      Caused by: org.infinispan.commons.marshall.NotSerializableException: org.keycloak.adapters.elytron.ElytronAccount

       

       

      Any thoughts on how to fix this issue?