<div dir="ltr">Checking the documentation for our examples I realise it needs a lot of improvement, and it's especially out of date for the demo :/<br><br>So here are the full command line instructions that work for me. If you're on windows you'll have to translate some of these commands into CLI / PowerShell.<div><br>Since you are only trying to install adapter I assume you want to run Keycloak server separately from your content server, but the demo works out-of-the box only when server and protected content are deployed in the same Wildfly instance. The instructions here configure server part separately from the client part, but within the same Wildfly instance.<br><br>So here we go ...<br><br>Download Wildfly 9.0.1, Keycloak Server, Keycloak Wildfly 9 Adapter, and Keycloak Examples. Use Google to find the Download pages ...<br><br>mkdir keycloak<br>cd keycloak<br>unzip ~/Downloads/wildfly-9.0.1.Final.zip<br>cd wildfly-9.0.1.Final<br><br>unzip ~/Downloads/keycloak-overlay-1.6.0.Final.zip<br>unzip ~/Downloads/keycloak-wf9-adapter-dist-1.6.0.Final.zip<br><br>(press 'A' for All when ask if you want to overwrite existing files - adapter and server overlay contain some of the same modules, since each has to be fully functional by itself)<br><br><br>Now we should open and edit standalone/configuration/standalone.xml to configure the server (and adapter) part, but we can also configure it directly through shell using jboss-cli tool:<br><br>bin/jboss-cli.sh<br><br><div>embed-server<div>/subsystem=datasources/data-source=KeycloakDS/:add(connection-url="jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE",driver-name=h2,jndi-name=java:jboss/datasources/KeycloakDS,password=sa,user-name=sa,use-java-context=true)<br>/subsystem=infinispan/cache-container=keycloak:add(jndi-name="infinispan/Keycloak")<br>/subsystem=infinispan/cache-container=keycloak/local-cache=realms:add()<br>/subsystem=infinispan/cache-container=keycloak/local-cache=users:add()<br>/subsystem=infinispan/cache-container=keycloak/local-cache=sessions:add()<br>/subsystem=infinispan/cache-container=keycloak/local-cache=loginFailures:add()<br>/extension=org.keycloak.keycloak-server-subsystem/:add(module=org.keycloak.keycloak-server-subsystem)<br>/subsystem=keycloak-server:add(web-context=auth)<br>quit<br><br><br>The configuration changes will be saved to standalone.xml file.<br><br><br>We can do the same in order to configure the adapter part:<br><br>bin/jboss-cli.sh<br><br>embed-server<br>/extension=org.keycloak.keycloak-adapter-subsystem/:add(module=org.keycloak.keycloak-adapter-subsystem)<br>/subsystem=keycloak:add()<br>quit<br><br><br>Again the changes will be saved to standalone.xml file.<br><br><br>Keycloak is now ready to run, but let's build, and deploy the demo, so that when we run Wildfly everything will be set up already.<br><br><br>Unpack, and build the demo:<br><br>cd ..</div><div><br>unzip ~/Downloads/keycloak-examples-1.6.0.Final.zip <br>cd keycloak-examples-1.6.0.Final/<br>cd preconfigured-demo/<br>mvn clean install<br><br><br>Deploy by copying to deployments dir:<br><br>cp database-service/target/database.war ../../wildfly-9.0.1.Final/standalone/deployments/<br>cp customer-app/target/customer-portal.war ../../wildfly-9.0.1.Final/standalone/deployments/<br>cp product-app/target/product-portal.war ../../wildfly-9.0.1.Final/standalone/deployments/<br><br><br>We also need to load into Keycloak server the demo realm that contains roles, users, and application clients for our demo to work. We can do this while starting up Keycloak server.<br><br>cd ../..<br><br>cd wildfly-9.0.1.Final<br><br>bin/standalone.sh -Dkeycloak.migration.action=import -Dkeycloak.migration.provider=singleFile -Dkeycloak.migration.realmName=demo -Dkeycloak.migration.file=../keycloak-examples-1.6.0.Final/preconfigured-demo/testrealm.json<br><br><br>Next time you start up Wildfly only use:<br><br>bin/standalone.sh<br><br><br>Otherwise you'll get an exception during startup notifying you that the 'demo' realm can't be imported, as it already exists!<br><br><br>Your Wildfly running Keycloak server, and the content apps (our demo, composed of customer-portal.war, product-portal.war, and database.war) is now ready for use. You can go to:</div><div><br></div><div><a href="http://localhost:8080/customer-portal">http://localhost:8080/customer-portal</a></div><div><br></div><div>and click around. When prompted for login, use '<a href="mailto:bburke@redhat.com">bburke@redhat.com</a>' as a username, and 'password' as a password.</div></div></div><div><br></div><div>Let me know if these instructions still don't work for you.</div><div><br></div><div>- marko</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 22, 2015 at 9:51 PM, Vijay Bhadriraju <span dir="ltr"><<a href="mailto:vbhadrir@us.ibm.com" target="_blank">vbhadrir@us.ibm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font size="2" face="sans-serif">Thanks, Marco. I was able to move forward
by using the latest adapter you pointed me to. I was able to bring up the
Wildfly 9.0 server with the adapter installed and was able to install the
Customer-Portal and Product-Portal example apps successfully. But, when
I install the Database example app, I get the following error. Any tips
on how to resolve this error ? Thanks.</font><br><br><font size="2" face="sans-serif">15:39:28,922 ERROR [org.jboss.msc.service.fail]
(MSC service thread 1-5) MSC000001: Failed</font><br><font size="2" face="sans-serif"> to start service jboss.deployment.unit.database.POST_MODULE:
org.jboss.msc.service.StartE</font><br><font size="2" face="sans-serif">xception in service jboss.deployment.unit.database.POST_MODULE:
WFLYSRV0153: Failed to pro</font><br><font size="2" face="sans-serif">cess phase POST_MODULE of deployment
"database"</font><br><font size="2" face="sans-serif"> at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitP</font><br><font size="2" face="sans-serif">haseService.java:163)</font><br><font size="2" face="sans-serif"> at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceContr</font><br><font size="2" face="sans-serif">ollerImpl.java:1948)</font><br><font size="2" face="sans-serif"> at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl</font><br><font size="2" face="sans-serif">.java:1881)</font><br><font size="2" face="sans-serif"> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
Source)</font><br><font size="2" face="sans-serif"> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source)</font><br><font size="2" face="sans-serif"> at java.lang.Thread.run(Unknown
Source)</font><br><font size="2" face="sans-serif">Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException:
WFLYRS0006: C</font><br><font size="2" face="sans-serif">ould not load JAX-RS Application class</font><br><font size="2" face="sans-serif"> at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.scan(JaxrsScanningProcesso</font><br><font size="2" face="sans-serif">r.java:205)</font><br><font size="2" face="sans-serif"> at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.deploy(JaxrsScanningProces</font><br><font size="2" face="sans-serif">sor.java:101)</font><br><font size="2" face="sans-serif"> at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitP</font><br><font size="2" face="sans-serif">haseService.java:156)</font><br><font size="2" face="sans-serif"> ... 5 more</font><br><font size="2" face="sans-serif">Caused by: java.lang.ClassNotFoundException:
org.keycloak.example.oauth.DataApplication fr</font><br><font size="2" face="sans-serif">om [Module "deployment.database:main"
from Service Module Loader]</font><br><font size="2" face="sans-serif"> at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)</font><br><font size="2" face="sans-serif"> at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentCla</font><br><font size="2" face="sans-serif">ssLoader.java:455)</font><br><font size="2" face="sans-serif"> at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClass</font><br><font size="2" face="sans-serif">Loader.java:404)</font><br><font size="2" face="sans-serif"> at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.</font><br><font size="2" face="sans-serif">java:385)</font><br><font size="2" face="sans-serif"> at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:13</font><br><font size="2" face="sans-serif">0)</font><br><font size="2" face="sans-serif"> at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.scan(JaxrsScanningProcesso</font><br><font size="2" face="sans-serif">r.java:201)</font><br><font size="2" face="sans-serif"> ... 7 more</font><br><br><font size="2" face="sans-serif">15:39:28,937 ERROR [org.jboss.as.controller.management-operation]
(management-handler-thre</font><br><font size="2" face="sans-serif">ad - 5) WFLYCTL0013: Operation ("add")
failed - address: ({"deployment" => "database"})
-</font><br><font size="2" face="sans-serif">failure description: {"WFLYCTL0080:
Failed services" => {"jboss.deployment.unit.database.P</font><br><font size="2" face="sans-serif">OST_MODULE" => "org.jboss.msc.service.StartException
in service jboss.deployment.unit.data</font><br><font size="2" face="sans-serif">base.POST_MODULE: WFLYSRV0153: Failed
to process phase POST_MODULE of deployment \"databas</font><br><font size="2" face="sans-serif">e\"</font><br><font size="2" face="sans-serif"> Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException:
WFLYRS000</font><br><font size="2" face="sans-serif">6: Could not load JAX-RS Application
class</font><br><font size="2" face="sans-serif"> Caused by: java.lang.ClassNotFoundException:
org.keycloak.example.oauth.DataApplicatio</font><br><font size="2" face="sans-serif">n from [Module \"deployment.database:main\"
from Service Module Loader]"}}</font><br><font size="2" face="sans-serif">15:39:28,953 ERROR [org.jboss.as.server]
(management-handler-thread - 5) WFLYSRV0021: Depl</font><br><font size="2" face="sans-serif">oy of deployment "database"
was rolled back with the following failure message:</font><br><font size="2" face="sans-serif">{"WFLYCTL0080: Failed services"
=> {"jboss.deployment.unit.database.POST_MODULE" => "org.j</font><br><font size="2" face="sans-serif">boss.msc.service.StartException in service
jboss.deployment.unit.database.POST_MODULE: WFL</font><br><font size="2" face="sans-serif">YSRV0153: Failed to process phase POST_MODULE
of deployment \"database\"</font><br><font size="2" face="sans-serif"> Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException:
WFLYRS000</font><br><font size="2" face="sans-serif">6: Could not load JAX-RS Application
class</font><br><font size="2" face="sans-serif"> Caused by: java.lang.ClassNotFoundException:
org.keycloak.example.oauth.DataApplicatio</font><br><font size="2" face="sans-serif">n from [Module \"deployment.database:main\"
from Service Module Loader]"}}</font><br><font size="2" face="sans-serif">15:39:28,953 INFO [org.jboss.as.server.deployment]
(MSC service thread 1-1) WFLYSRV0028:</font><br><font size="2" face="sans-serif">Stopped deployment database (runtime-name:
database) in 11ms</font><br><font size="2" face="sans-serif">15:39:28,953 INFO [org.jboss.as.controller]
(management-handler-thread - 5) WFLYCTL0183:</font><br><font size="2" face="sans-serif">Service status report</font><br><font size="2" face="sans-serif">WFLYCTL0186: Services which failed
to start: service jboss.deployment.unit.database</font><br><font size="2" face="sans-serif">.POST_MODULE</font><br><br><font size="2" face="sans-serif">Regards, Vijay</font><br><br><br><br><br><font size="1" color="#5f5f5f" face="sans-serif">From:
</font><font size="1" face="sans-serif">Marko Strukelj <<a href="mailto:mstrukel@redhat.com" target="_blank">mstrukel@redhat.com</a>></font><br><font size="1" color="#5f5f5f" face="sans-serif">To:
</font><font size="1" face="sans-serif">Vijay Bhadriraju/Raleigh/IBM@IBMUS</font><br><font size="1" color="#5f5f5f" face="sans-serif">Cc:
</font><font size="1" face="sans-serif">keycloak-user <<a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a>></font><br><font size="1" color="#5f5f5f" face="sans-serif">Date:
</font><font size="1" face="sans-serif">10/22/2015 12:47 PM</font><br><font size="1" color="#5f5f5f" face="sans-serif">Subject:
</font><font size="1" face="sans-serif">Re: [keycloak-user]
Exception loading Keycloak modules in Wildfly 9.0</font><br><hr noshade><div class="HOEnZb"><div class="h5"><br><br><br><font size="3">Use the latest keycloak-wf9-adapter-dist from the download
site: </font><a href="http://keycloak.jboss.org/keycloak/downloads.html?dir=0%3Dadapters/keycloak-oidc%3B" target="_blank"><font size="3" color="blue"><u>http://keycloak.jboss.org/keycloak/downloads.html?dir=0%3Dadapters/keycloak-oidc%3B</u></font></a><br><br><font size="3">You're trying to use latest config syntax with an old
version that uses a different kind of config, and is outdated.</font><br><br><font size="3">On Thu, Oct 22, 2015 at 6:02 PM, Vijay Bhadriraju <</font><a href="mailto:vbhadrir@us.ibm.com" target="_blank"><font size="3" color="blue"><u>vbhadrir@us.ibm.com</u></font></a><font size="3">>
wrote:</font><br><font size="2" face="sans-serif">I am getting the following exception
after unzipping the keycloak-wildfly-adapter-dist-1.1.0.Final.zip into
the WildFly 9.0 server and configuring the standalone.xml file with the
following lines as described in the keycloak documentation. I have tried
this with Wildfly 10.0 version also and get the same error.</font><font size="3"><br></font><tt><font size="1"><br><server xmlns="urn:jboss:domain:1.4"><br><extensions><b><br><extension module="org.keycloak.keycloak-adapter-subsystem"/></b><br>...<br></extensions><br><profile><b><br><subsystem xmlns="urn:jboss:domain:keycloak:1.1"/></b><br>...<br></profile></font></tt><font size="3"><br></font><font size="2" face="sans-serif"><br>How do I resolve this keycloak module loading exception?</font><font size="3"><br><br></font><font size="2" face="sans-serif"><br>11:35:36,018 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055:
Caught exce<br>ption during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException:<br>WFLYCTL0085: Failed to parse configuration<br> at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigura<br>tionPersister.java:131) [wildfly-controller-2.0.0.CR7.jar:2.0.0.CR7]<br> at org.jboss.as.server.ServerService.boot(ServerService.java:356)
[wildfly-server-<br>2.0.0.CR7.jar:2.0.0.CR7]<br> at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerServi<br>ce.java:299) [wildfly-controller-2.0.0.CR7.jar:2.0.0.CR7]<br> at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_65]<br>Caused by: javax.xml.stream.XMLStreamException: WFLYCTL0083: Failed to
load module org.key<br>cloak.keycloak-adapter-subsystem<br> at org.jboss.as.controller.parsing.ExtensionXml.parseExtensions(ExtensionXml.java:<br>155) [wildfly-controller-2.0.0.CR7.jar:2.0.0.CR7]<br> at org.jboss.as.server.parsing.StandaloneXml_4.readServerElement(StandaloneXml_4.j<br>ava:220) [wildfly-server-2.0.0.CR7.jar:2.0.0.CR7]<br> at org.jboss.as.server.parsing.StandaloneXml_4.readElement(StandaloneXml_4.java:14<br>3) [wildfly-server-2.0.0.CR7.jar:2.0.0.CR7]<br> at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:69)
[w<br>ildfly-server-2.0.0.CR7.jar:2.0.0.CR7]<br> at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:47)
[w<br>ildfly-server-2.0.0.CR7.jar:2.0.0.CR7]<br> at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
[staxm<br>apper-1.2.0.Final.jar:1.2.0.Final]<br> at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
[staxma<br>pper-1.2.0.Final.jar:1.2.0.Final]<br> at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigura<br>tionPersister.java:123) [wildfly-controller-2.0.0.CR7.jar:2.0.0.CR7]<br> ... 3 more<br>Caused by: java.util.concurrent.ExecutionException: javax.xml.stream.XMLStreamException:
W<br>FLYCTL0083: Failed to load module<br> at java.util.concurrent.FutureTask.report(Unknown
Source) [rt.jar:1.8.0_65]<br> at java.util.concurrent.FutureTask.get(Unknown
Source) [rt.jar:1.8.0_65]<br> at org.jboss.as.controller.parsing.ExtensionXml.parseExtensions(ExtensionXml.java:<br>147) [wildfly-controller-2.0.0.CR7.jar:2.0.0.CR7]<br> ... 10 more<br>Caused by: javax.xml.stream.XMLStreamException: WFLYCTL0083: Failed to
load module<br> at org.jboss.as.controller.parsing.ExtensionXml.loadModule(ExtensionXml.java:196)<br>[wildfly-controller-2.0.0.CR7.jar:2.0.0.CR7]<br> at org.jboss.as.controller.parsing.ExtensionXml.access$000(ExtensionXml.java:69)
[<br>wildfly-controller-2.0.0.CR7.jar:2.0.0.CR7]<br> at org.jboss.as.controller.parsing.ExtensionXml$1.call(ExtensionXml.java:127)
[wil<br>dfly-controller-2.0.0.CR7.jar:2.0.0.CR7]<br> at org.jboss.as.controller.parsing.ExtensionXml$1.call(ExtensionXml.java:124)
[wil<br>dfly-controller-2.0.0.CR7.jar:2.0.0.CR7]<br> at java.util.concurrent.FutureTask.run(Unknown
Source) [rt.jar:1.8.0_65]<br> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
Source) [rt.jar:1.8.0<br>_65]<br> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source) [rt.jar:1.8.<br>0_65]<br> at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_65]<br> at org.jboss.threads.JBossThread.run(JBossThread.java:320)
[</font><a href="http://jboss-threads-2.2.1.fi/" target="_blank"><font size="2" color="blue" face="sans-serif"><u>jboss-threads-2.2.1.Fi</u></font></a><font size="2" face="sans-serif"><br>nal.jar:2.2.1.Final]<br>Caused by: org.jboss.modules.ModuleNotFoundException: org.keycloak.keycloak-adapter-subsys<br>tem:main<br> at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:236)
[jboss-modules<br>.jar:1.4.4.Final]<br> at org.jboss.as.controller.parsing.ExtensionXml.loadModule(ExtensionXml.java:178)<br>[wildfly-controller-2.0.0.CR7.jar:2.0.0.CR7]<br> ... 8 more</font><font size="3"><br></font><font size="2" face="sans-serif"><br>Regards, Vijay</font><font size="3"><br><br><br>_______________________________________________<br>keycloak-user mailing list</font><font size="3" color="blue"><u><br></u></font><a href="mailto:keycloak-user@lists.jboss.org" target="_blank"><font size="3" color="blue"><u>keycloak-user@lists.jboss.org</u></font></a><font size="3" color="blue"><u><br></u></font><a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank"><font size="3" color="blue"><u>https://lists.jboss.org/mailman/listinfo/keycloak-user</u></font></a><br><br><br></div></div></blockquote></div><br></div>