{"action":"opened","issue":{"url":"https://api.github.com/repos/jboss-dockerfiles/keycloak/issues/35","labels_url":"https://api.github.com/repos/jboss-dockerfiles/keycloak/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/jboss-dockerfiles/keycloak/issues/35/comments","events_url":"https://api.github.com/repos/jboss-dockerfiles/keycloak/issues/35/events","html_url":"https://github.com/jboss-dockerfiles/keycloak/issues/35","id":114154383,"number":35,"title":"jboss/keycloak-mongo Failed to connect to database","user":{"login":"techgaun","id":1886670,"avatar_url":"https://avatars.githubusercontent.com/u/1886670?v=3","gravatar_id":"","url":"https://api.github.com/users/techgaun","html_url":"https://github.com/techgaun","followers_url":"https://api.github.com/users/techgaun/followers","following_url":"https://api.github.com/users/techgaun/following{/other_user}","gists_url":"https://api.github.com/users/techgaun/gists{/gist_id}","starred_url":"https://api.github.com/users/techgaun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techgaun/subscriptions","organizations_url":"https://api.github.com/users/techgaun/orgs","repos_url":"https://api.github.com/users/techgaun/repos","events_url":"https://api.github.com/users/techgaun/events{/privacy}","received_events_url":"https://api.github.com/users/techgaun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-29T21:44:48Z","updated_at":"2015-10-29T21:44:48Z","closed_at":null,"body":"Trying to use https://github.com/jboss-dockerfiles/keycloak/tree/master/server-mongo , it just gives me error:\r\n```\r\n21:35:42,014 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 63) 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: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)\r\n\tat org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)\r\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)\r\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:262)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\n\tat org.jboss.threads.JBossThread.run(JBossThread.java:320)\r\nCaused by: java.lang.RuntimeException: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)\r\n\tat org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:160)\r\n\tat org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2211)\r\n\tat org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:295)\r\n\tat org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:236)\r\n\tat org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:112)\r\n\tat org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)\r\n\tat io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)\r\n\tat org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)\r\n\tat io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)\r\n\tat io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:230)\r\n\tat io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:131)\r\n\tat io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:511)\r\n\tat org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:101)\r\n\tat org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)\r\n\t... 6 more\r\nCaused by: java.lang.RuntimeException: Failed to connect to database\r\n\tat org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.getConnection(DefaultJpaConnectionProviderFactory.java:207)\r\n\tat org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.lazyInit(DefaultJpaConnectionProviderFactory.java:128)\r\n\tat org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.java:40)\r\n\tat org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.java:28)\r\n\tat org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.java:103)\r\n\tat org.keycloak.models.jpa.session.JpaUserSessionPersisterProviderFactory.create(JpaUserSessionPersisterProviderFactory.java:21)\r\n\tat org.keycloak.models.jpa.session.JpaUserSessionPersisterProviderFactory.create(JpaUserSessionPersisterProviderFactory.java:15)\r\n\tat org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.java:103)\r\n\tat org.keycloak.models.sessions.infinispan.initializer.OfflineUserSessionLoader.init(OfflineUserSessionLoader.java:20)\r\n\tat org.keycloak.models.sessions.infinispan.initializer.InfinispanUserSessionInitializer$1.run(InfinispanUserSessionInitializer.java:100)\r\n\tat org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:244)\r\n\tat org.keycloak.models.sessions.infinispan.initializer.InfinispanUserSessionInitializer.getOrCreateInitializerState(InfinispanUserSessionInitializer.java:97)\r\n\tat org.keycloak.models.sessions.infinispan.initializer.InfinispanUserSessionInitializer.startLoading(InfinispanUserSessionInitializer.java:148)\r\n\tat org.keycloak.models.sessions.infinispan.initializer.InfinispanUserSessionInitializer.loadPersistentSessions(InfinispanUserSessionInitializer.java:78)\r\n\tat org.keycloak.models.sessions.infinispan.InfinispanUserSessionProviderFactory$3.run(InfinispanUserSessionProviderFactory.java:111)\r\n\tat org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:244)\r\n\tat org.keycloak.models.sessions.infinispan.InfinispanUserSessionProviderFactory.loadPersistentSessions(InfinispanUserSessionProviderFactory.java:102)\r\n\tat org.keycloak.models.sessions.infinispan.InfinispanUserSessionProviderFactory$2.onEvent(InfinispanUserSessionProviderFactory.java:86)\r\n\tat org.keycloak.services.DefaultKeycloakSessionFactory.publish(DefaultKeycloakSessionFactory.java:47)\r\n\tat org.keycloak.services.resources.KeycloakApplication.<init>(KeycloakApplication.java:87)\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)\r\n\tat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\r\n\tat java.lang.reflect.Constructor.newInstance(Constructor.java:526)\r\n\tat org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:148)\r\n\t... 19 more\r\nCaused by: java.lang.NullPointerException\r\n\tat java.lang.Class.forName0(Native Method)\r\n\tat java.lang.Class.forName(Class.java:195)\r\n\tat org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.getConnection(DefaultJpaConnectionProviderFactory.java:203)\r\n\t... 43 more\r\n\r\n21:35:42,020 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\" => \"org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./auth: java.lang.RuntimeException: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)\r\n    Caused by: java.lang.RuntimeException: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)\r\n    Caused by: java.lang.RuntimeException: Failed to connect to database\r\n    Caused by: java.lang.NullPointerException\"}}\r\n21:35:42,057 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 57) WFLYSRV0010: Deployed \"keycloak-server.war\" (runtime-name : \"keycloak-server.war\")\r\n21:35:42,059 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report\r\nWFLYCTL0186:   Services which 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: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)\r\n\r\n21:35:42,227 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management\r\n21:35:42,227 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990\r\n21:35:42,227 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: Keycloak 1.6.1.Final (WildFly Core 1.0.1.Final) started (with errors) in 3017ms - Started 305 of 527 services (2 services failed or missing dependencies, 274 services are lazy, passive or on-demand)\r\n```\r\n\r\nI entered the container and can see following environment variables:\r\n```\r\nMONGO_1_PORT_27017_TCP_ADDR=172.17.0.11\r\nMONGO_ENV_MONGO_MAJOR=3.0\r\nHOSTNAME=42c87ce29c70\r\nMONGO_1_ENV_MONGO_VERSION=3.0.7\r\nMONGO_1_PORT_27017_TCP=tcp://172.17.0.11:27017\r\nMONGO_1_PORT=tcp://172.17.0.11:27017\r\nKEYCLOAK_MONGO_1_ENV_MONGO_VERSION=3.0.7\r\nMONGO_1_ENV_MONGO_MAJOR=3.0\r\nMONGO_1_PORT_27017_TCP_PROTO=tcp\r\nLAUNCH_JBOSS_IN_BACKGROUND=1\r\nKEYCLOAK_MONGO_1_PORT_27017_TCP_ADDR=172.17.0.11\r\nKEYCLOAK_MONGO_1_PORT_27017_TCP_PROTO=tcp\r\nMONGO_PORT=tcp://172.17.0.11:27017\r\nKEYCLOAK_MONGO_1_NAME=/keycloak_keycloak_1/keycloak_mongo_1\r\nJBOSS_HOME=/opt/jboss/keycloak\r\nMONGO_ENV_MONGO_VERSION=3.0.7\r\nMONGO_PORT_27017_TCP=tcp://172.17.0.11:27017\r\nMONGO_1_ENV_MONGODB_DBNAME=keycloak\r\nLS_COLORS=\r\nKEYCLOAK_MONGO_1_ENV_MONGO_MAJOR=3.0\r\nPATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\r\nMONGO_1_PORT_27017_TCP_PORT=27017\r\nKEYCLOAK_MONGO_1_PORT_27017_TCP=tcp://172.17.0.11:27017\r\nKEYCLOAK_MONGO_1_PORT=tcp://172.17.0.11:27017\r\nPWD=/opt/jboss\r\nJAVA_HOME=/usr/lib/jvm/java\r\nMONGO_PORT_27017_TCP_PROTO=tcp\r\nKEYCLOAK_VERSION=1.6.1.Final\r\nSHLVL=1\r\nHOME=/opt/jboss\r\nMONGO_ENV_MONGODB_DBNAME=keycloak\r\nMONGO_1_NAME=/keycloak_keycloak_1/mongo_1\r\nMONGO_PORT_27017_TCP_ADDR=172.17.0.11\r\naffinity:container==d304843896d19664f2a9ce1ad75b05408a7f2dfcf17d373499bf3b3cfcd4cbb6\r\nMONGODB_DBNAME=keycloak\r\nLESSOPEN=||/usr/bin/lesspipe.sh %s\r\nKEYCLOAK_MONGO_1_ENV_MONGODB_DBNAME=keycloak\r\nKEYCLOAK_MONGO_1_PORT_27017_TCP_PORT=27017\r\nMONGO_NAME=/keycloak_keycloak_1/mongo\r\nMONGO_PORT_27017_TCP_PORT=27017\r\n```\r\n\r\nThis looks good to me. However, I could not get `jboss/keycloak-mongo` working by following the readme."}}