The Keycloak Quickstarts project app-authz-uma-photoz fails to deploy. I have tried two approaches.
Both approaches run Keycloak using Docker. Note that I have also tried running Keycloak as in the CI, but to no avail. The Docker build context is app-authz-uma-photoz.
keycloak.Dockerfile
FROM jboss/keycloak:15.0.2
COPY photoz-realm.json /tmp/realm.json
COPY photoz-js-policies/target/photoz-uma-js-policies.jar \
${JBOSS_HOME}/standalone/deployments/
docker-compose.yml
version: "3.9"
services:
keycloak:
build:
context: .
dockerfile: keycloak.Dockerfile
ports:
- 8180:8080
environment:
KEYCLOAK_USER: foo
KEYCLOAK_PASSWORD: bar
KEYCLOAK_IMPORT: /tmp/realm.json
With the Docker setup in place, the README steps “Create the Example Realm and a Resource Server” should be covered.
That leaves the steps “Deploy and Run the quickstart applications”. This is where the trouble is.
- Deploying the client and API as described,
cd photoz-html5-client && mvn clean wildfly:deploy
cd photoz-restful-api && mvn clean package wildfly:deploy
Both fail with:
[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.2.2.Final:deploy (default-cli) on project photoz-uma-html5-client: Failed to execute goal deploy.: java.net.ConnectException: WFLYPRT0053: Could not connect to remote+http://localhost:9990. The connection failed: Connection refused -> [Help 1]
- Circumventing the WildFly Maven plugin by deploying the WAR files to a WildFly image,
app.Dockerfile
FROM jboss/wildfly:25.0.0.Final
WORKDIR $JBOSS_HOME
COPY photoz-html5-client/target/photoz-uma-html5-client.war \
standalone/deployments/photoz-html5-client.war
COPY photoz-restful-api/target/photoz-uma-restful-api.war \
standalone/deployments/photoz-restful-api.war
This takes care of deploying the client quite nicely. With the API, however, there are JBoss module issues - maybe it has something to do with the Maven settings / the JBoss mirror? See the CI Maven settings.
docker build -f app.Dockerfile -t app .
docker run -it --rm -p 8080:8080 app
18:23:03,900 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.module.service."deployment.photoz-restful-api.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.photoz-restful-api.war".main: WFLYSRV0179: Failed to load module: deployment.photoz-restful-api.war [...] Caused by: org.jboss.modules.ModuleNotFoundException: org.keycloak.keycloak-authz-client
I have tried creating this JBoss module using the JBoss CLI, but none of the dependencies for it are there either, which leads to installing the entire tree manually.
How can I get this project to start? I don’t care how it is done, Docker or otherwise.