在开发模式下,jhipster Keycloak并非以docker-compose开头

时间:2018-10-25 11:58:42

标签: docker jhipster keycloak

我是Jhipster的新手,我用Keycloak进行了尝试。 我使用JHipster 5,阅读了README文件,并且在DEV模式下在计算机上运行命令 docker-compose -f src / main / docker / keycloak.yml up 时,出现以下错误

有人可以帮助我吗?

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 个答案:

答案 0 :(得分:0)

我自己解决了问题
CentOs7上的默认docker-compose版本太旧。
有两种可能性:

  • 升级docker-compose
  • 运行以下命令
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

其中keycloak-env.properties具有以下内容

KEYCLOAK_USER=admin
KEYCLOAK_PASSWORD=admin
DB_VENDOR=h2