<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New","serif";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi ,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks for your response.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">keycloak-war-dist 1.1.0.Final works for me too.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Actually I have custom application similar to “ups-auth-server” . In pom.xml I am using “<b>keycloak-dependencies-server-min</b>” artifact and added necessary infinispan related dependencies (keycloak-connections-infinispan,</span>
<span style="color:#1F497D">keycloak-model-sessions-infinispan,</span> <span style="color:#1F497D">
keycloak-invalidation-cache-infinispan).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Yes, I have added additional <b>
“infinispan-core”</b> dependency in my pom.xml as jboss class loader was unable to find EmbeddedCacheManager.class .<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I see in your pom.xml you are using “<b>keycloak-dependencies-server-all”
</b>, do I need to use the same ( although I may not need all the dependencies)? <o:p>
</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Bappaditya Gorai<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> Marek Posolda [mailto:mposolda@redhat.com]
<br>
<b>Sent:</b> Tuesday, February 24, 2015 7:46 PM<br>
<b>To:</b> Bappaditya Gorai (bgorai); keycloak-dev@lists.jboss.org<br>
<b>Subject:</b> Re: [keycloak-dev] Keycloak Clustering 1.1.0.Final - Getting infinispan type casting error (DefaultCacheContainer to EmbeddedCacheManager) in DefaultInfinispanConnectionProviderFactory<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi,<br>
<br>
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? <br>
<br>
What I did for clustered Keycloak on EAP 6.3:<br>
<br>
1) Unpack keycloak-war-dist 1.1.0.Final to my jboss-eap 6.3<br>
2) Configured standalone/configuration/standalone-ha.xml and add this under infinispan subsystem:<br>
<br>
<cache-container name="keycloak" jndi-name="infinispan/Keycloak" start="EAGER"> <br>
<transport lock-timeout="60000"/><br>
<distributed-cache name="sessions" mode="SYNC" owners="2" segments="60"/> <br>
<distributed-cache name="loginFailures" mode="SYNC" owners="2" segments="60"/> <br>
<invalidation-cache name="realms" mode="SYNC"/><br>
<invalidation-cache name="users" mode="SYNC"/><br>
</cache-container><br>
<br>
3) Configured standalone/configuration/keycloak-server.json and add this:<br>
<br>
"connectionsInfinispan": {<br>
"default" : {<br>
"cacheContainer" : "java:jboss/infinispan/Keycloak"<br>
}<br>
}<br>
<br>
and also switch realmCache, userCache and userSessions to use: "provider": "infinispan"<br>
<br>
4) Then run server with command:<br>
./standalone.sh -c standalone-ha.xml<br>
<br>
Let me know if these steps work for you.<br>
<br>
Marek<br>
<br>
On 24.2.2015 14:07, Bappaditya Gorai (bgorai) wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">In my standalone configuration file I am using following subsystem version for infinispan, not sure whether it has any relevance to my issue.<o:p></o:p></p>
<p class="MsoNormal"><span style="color:#C0504D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#C0504D"><subsystem xmlns="urn:jboss:domain:infinispan:1.5"></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Bappaditya Gorai</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Bappaditya Gorai (bgorai)
<br>
<b>Sent:</b> Monday, February 23, 2015 2:46 PM<br>
<b>To:</b> <a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
<b>Subject:</b> Keycloak Clustering 1.1.0.Final - Getting infinispan type casting error (DefaultCacheContainer to EmbeddedCacheManager) in DefaultInfinispanConnectionProviderFactory</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Hi Team,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">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 “<b>Chapter 24. Clustering</b>” in Keycloak Guide (<a href="http://docs.jboss.org/keycloak/docs/1.1.0.Final/userguide/html/clustering.html">http://docs.jboss.org/keycloak/docs/1.1.0.Final/userguide/html/clustering.html</a>).
Let me know if I am missing something.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="color:#C0504D">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:
<b>java.lang.ClassCastException: org.jboss.as.clustering.infinispan.DefaultCacheContainer cannot be cast to org.infinispan.manager.EmbeddedCacheManager</b></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#C0504D"> at org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory.initContainerManaged(<b>DefaultInfinispanConnectionProviderFactory.java:70</b>) [keycloak-connections-infinispan-1.1.0.Final.jar:1.1.0.Final]</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#C0504D"> at org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory.lazyInit(DefaultInfinispanConnectionProviderFactory.java:59) [keycloak-connections-infinispan-1.1.0.Final.jar:1.1.0.Final]</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#C0504D"> at org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory.create(DefaultInfinispanConnectionProviderFactory.java:30) [keycloak-connections-infinispan-1.1.0.Final.jar:1.1.0.Final]</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#C0504D"> at org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory.create(DefaultInfinispanConnectionProviderFactory.java:18) [keycloak-connections-infinispan-1.1.0.Final.jar:1.1.0.Final]</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#C0504D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#C0504D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#C0504D"> </span><o:p></o:p></p>
<p class="MsoNormal">Thanks<o:p></o:p></p>
<p class="MsoNormal">Bappaditya Gorai<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>keycloak-dev mailing list<o:p></o:p></pre>
<pre><a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><o:p></o:p></pre>
<pre><a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><o:p> </o:p></span></p>
</div>
</body>
</html>