0
votes

I'm new in Jhipster and I tried it with Keycloak. I use JHipster 5, I read the README file and when I run command docker-compose -f src/main/docker/keycloak.yml up on my computer with the DEV mode, I got the following error.

Anyone can help me please?

keycloak_1  | 08:07:53,713 INFO  [org.hibernate.hql.internal.QueryTranslatorFactoryInitiator] (ServerService Thread Pool -- 60) HHH000397: Using ASTQueryTranslatorFactory
keycloak_1  | 08:07:57,279 INFO  [org.keycloak.exportimport.dir.DirImportProvider] (ServerService Thread Pool -- 60) Importing from directory /opt/jboss/keycloak/realm-config
keycloak_1  | 08:07:57,330 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 60) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./auth: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./auth: java.lang.RuntimeException: RESTEASY003325: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
keycloak_1  |   at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:81)
keycloak_1  |   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
keycloak_1  |   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
keycloak_1  |   at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
keycloak_1  |   at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
keycloak_1  |   at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
keycloak_1  |   at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
keycloak_1  |   at java.lang.Thread.run(Thread.java:748)
keycloak_1  |   at org.jboss.threads.JBossThread.run(JBossThread.java:485)
keycloak_1  | Caused by: java.lang.RuntimeException: RESTEASY003325: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
keycloak_1  |   at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:162)
keycloak_1  |   at org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2676)
keycloak_1  |   at org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:361)
keycloak_1  |   at org.jboss.resteasy.spi.ResteasyDeployment.startInternal(ResteasyDeployment.java:274)
keycloak_1  |   at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:86)
keycloak_1  |   at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:119)
keycloak_1  |   at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)
keycloak_1  |   at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
keycloak_1  |   at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
keycloak_1  |   at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
keycloak_1  |   at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:300)
keycloak_1  |   at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:140)
keycloak_1  |   at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:584)
keycloak_1  |   at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:555)
keycloak_1  |   at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
keycloak_1  |   at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
keycloak_1  |   at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
keycloak_1  |   at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1514)
keycloak_1  |   at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1514)
keycloak_1  |   at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1514)
keycloak_1  |   at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1514)
keycloak_1  |   at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:597)
keycloak_1  |   at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:97)
keycloak_1  |   at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
keycloak_1  |   ... 8 more
keycloak_1  | Caused by: java.lang.NullPointerException
keycloak_1  |   at org.keycloak.exportimport.dir.DirImportProvider.getRealmsToImport(DirImportProvider.java:99)
keycloak_1  |   at org.keycloak.exportimport.dir.DirImportProvider.isMasterRealmExported(DirImportProvider.java:85)
keycloak_1  |   at org.keycloak.exportimport.ExportImportManager.isImportMasterIncluded(ExportImportManager.java:72)
keycloak_1  |   at org.keycloak.services.resources.KeycloakApplication.migrateAndBootstrap(KeycloakApplication.java:212)
keycloak_1  |   at org.keycloak.services.resources.KeycloakApplication$1.run(KeycloakApplication.java:145)
keycloak_1  |   at org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:227)
keycloak_1  |   at org.keycloak.services.resources.KeycloakApplication.(KeycloakApplication.java:136)
keycloak_1  |   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
keycloak_1  |   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
keycloak_1  |   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
keycloak_1  |   at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
keycloak_1  |   at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:150)
keycloak_1  |   ... 31 more
keycloak_1  |
keycloak_1  | 08:07:57,391 INFO  [org.jboss.as.server] (Thread-2) WFLYSRV0220: Server shutdown has been requested via an OS signal
keycloak_1  | 08:07:57,531 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "keycloak-server.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./auth" => "java.lang.RuntimeException: RESTEASY003325: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
keycloak_1  |     Caused by: java.lang.RuntimeException: RESTEASY003325: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
keycloak_1  |     Caused by: java.lang.NullPointerException"}}
keycloak_1  | 08:07:57,667 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-1) ISPN000080: Disconnecting JGroups channel ejb
1

1 Answers

0
votes

I solved the problem myself
Default docker-compose version on CentOs7 was too old.
So two possibilities:

  • Upgrade docker-compose
  • Run the following command
docker run -d -v realm-config:/opt/jboss/keycloak/realm-config --env-file keycloak-env.properties -p 9080:9080 -p 9443:9443 -p 10990:10990 jboss/
keycloak:4.5.0.Final

Where keycloak-env.properties has the following content

KEYCLOAK_USER=admin
KEYCLOAK_PASSWORD=admin
DB_VENDOR=h2