[keycloak-user] Problem when we execute storage provider SPI in domain mode.

Cindy Margarita Pacheco Alvarez cindy.pacheco at payulatam.com
Fri May 12 16:19:56 EDT 2017


We have created a storage provider SPI with keycloak-2.2.1.Final but we have a problem when we execute this SPI in domain mode. We use a postgres XADatasource and we create the SPI in the same way as the storage provider example. We have a master with a single slave.

When we ask for a token we have the following error:

The pre-jca synchronization org.jboss.as.ejb3.component.stateful.StatefulSessionSynchronizationInterceptor$StatefulSessionSynchronization at 3a417315 associated with tx TransactionImple < ac, BasicAction: 0:ffffc0a83866:-33c4bf71:5910ee3a:da status: ActionStatus.ABORTED > failed during after completion: java.lang.IllegalStateException: Transaction DummyTransaction{xid=DummyXid{id=11}, status=1} is not in a valid state to be invoking cache operations on…….
And
org.infinispan.util.concurrent.TimeoutException: ISPN000299: Unable to acquire lock after 10 seconds for key f:96007b81-fe12-491d-9a7f-c0bfabc8345a:name.lastname and requestor GlobalTransaction:<null>:13:local. Lock is held by GlobalTransaction:<null>:10:local…..
(you can see the complete trace in log.log, adjunted in this e-mail)
-------





we’ve applied the solution of http://lists.jboss.org/pipermail/keycloak-user/2016-October/007901.html but when we do a lot of requests we have an error with the entity manager.



12:20:20,203 ERROR [io.undertow.request] (default task-13) UT005023: Exception handling request to /auth/realms/Latam-Realm/protocol/openid-connect/token: org.jboss.resteasy.spi.UnhandledException: org.keycloak.models.ModelException: java.lang.IllegalStateException: EntityManager is closed
[Server:server-one]     at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:76)
[Server:server-one]     at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:212)
[Server:server-one]     at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:168)
[Server:server-one]     at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:411)
[Server:server-one]     at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:202)
[Server:server-one]     at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)
[Server:server-one]     at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
[Server:server-one]     at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
[Server:server-one]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
[Server:server-one]     at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
[Server:server-one]     at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
[Server:server-one]     at org.keycloak.services.filters.KeycloakSessionServletFilter.doFilter(KeycloakSessionServletFilter.java:90)
[Server:server-one]     at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)
[Server:server-one]     at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
[Server:server-one]     at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
[Server:server-one]     at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
[Server:server-one]     at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
[Server:server-one]     at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
[Server:server-one]     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
[Server:server-one]     at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
[Server:server-one]     at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)




All of this only happen when we use domain mode with different slaves. But in standalone mode in local machines works perfectly.







More information about the keycloak-user mailing list