[keycloak-dev] Keycloak Clustering 1.1.0.Final - Getting infinispan type casting error (DefaultCacheContainer to EmbeddedCacheManager) in DefaultInfinispanConnectionProviderFactory

Marek Posolda mposolda at redhat.com
Tue Feb 24 09:16:01 EST 2015


Hi,

I can't reproduce the issue. It's strange as 
org.jboss.as.clustering.infinispan.DefaultCacheContainer is subclass of 
org.infinispan.manager.EmbeddedCacheManager. Didn't you do some 
packaging changes like adding infinispan jars to 
auth-server.war/WEB-INF/lib or something like that?

What I did for clustered Keycloak on EAP 6.3:

1) Unpack keycloak-war-dist 1.1.0.Final to my jboss-eap 6.3
2) Configured standalone/configuration/standalone-ha.xml and add this 
under infinispan subsystem:

  <cache-container name="keycloak" jndi-name="infinispan/Keycloak" 
start="EAGER">
   <transport lock-timeout="60000"/>
   <distributed-cache name="sessions" mode="SYNC" owners="2" 
segments="60"/>
   <distributed-cache name="loginFailures" mode="SYNC" owners="2" 
segments="60"/>
   <invalidation-cache name="realms" mode="SYNC"/>
   <invalidation-cache name="users"  mode="SYNC"/>
  </cache-container>

3) Configured standalone/configuration/keycloak-server.json and add this:

"connectionsInfinispan": {
     "default" : {
         "cacheContainer" : "java:jboss/infinispan/Keycloak"
     }
}

and also switch realmCache, userCache and userSessions to use: 
"provider": "infinispan"

4) Then run server with command:
./standalone.sh -c standalone-ha.xml

Let me know if these steps work for you.

Marek

On 24.2.2015 14:07, Bappaditya Gorai (bgorai) wrote:
>
> In my standalone configuration file I am using following subsystem 
> version for infinispan, not sure whether it has any relevance to my issue.
>
> <subsystem xmlns="urn:jboss:domain:infinispan:1.5">
>
> Thanks
>
> Bappaditya Gorai
>
> *From:*Bappaditya Gorai (bgorai)
> *Sent:* Monday, February 23, 2015 2:46 PM
> *To:* keycloak-dev at lists.jboss.org
> *Subject:* Keycloak Clustering 1.1.0.Final - Getting infinispan type 
> casting error (DefaultCacheContainer to EmbeddedCacheManager) in 
> DefaultInfinispanConnectionProviderFactory
>
> Hi Team,
>
> I am trying  configure  Keycloak in clustered environment (EAP 6.3), 
> however getting following error (stack trace is provided below) . I 
> have followed instructions provided in “*Chapter 24. Clustering*” in 
> Keycloak Guide 
> (http://docs.jboss.org/keycloak/docs/1.1.0.Final/userguide/html/clustering.html). 
> Let me know if I am missing something.
>
> 13:23:25,681 ERROR 
> [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/auth]] 
> (ServerService Thread Pool -- 62) JBWEB000289: Servlet Keycloak REST 
> Interface threw load() exception: *java.lang.ClassCastException: 
> org.jboss.as.clustering.infinispan.DefaultCacheContainer cannot be 
> cast to org.infinispan.manager.EmbeddedCacheManager*
>
>         at 
> org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory.initContainerManaged(*DefaultInfinispanConnectionProviderFactory.java:70*) 
> [keycloak-connections-infinispan-1.1.0.Final.jar:1.1.0.Final]
>
>         at 
> org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory.lazyInit(DefaultInfinispanConnectionProviderFactory.java:59) 
> [keycloak-connections-infinispan-1.1.0.Final.jar:1.1.0.Final]
>
>         at 
> org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory.create(DefaultInfinispanConnectionProviderFactory.java:30) 
> [keycloak-connections-infinispan-1.1.0.Final.jar:1.1.0.Final]
>
>         at 
> org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory.create(DefaultInfinispanConnectionProviderFactory.java:18) 
> [keycloak-connections-infinispan-1.1.0.Final.jar:1.1.0.Final]
>
> Thanks
>
> Bappaditya Gorai
>
>
>
> _______________________________________________
> keycloak-dev mailing list
> keycloak-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-dev/attachments/20150224/5c20933e/attachment.html 


More information about the keycloak-dev mailing list