<div dir="ltr">Hi, All:<div><br></div><div>I received this database connection failure issue. Any idea of how to fix it? Thank you.</div><div><br></div><div><br></div><div><div>Caused by: java.lang.RuntimeException: Failed to connect to database</div><div>        at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.getConnection(DefaultJpaConnectionProviderFactory.java:209)</div><div>        at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.lazyInit(DefaultJpaConnectionProviderFactory.java:130)</div><div>        at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.java:42)</div><div>        at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.java:30)</div><div>        at org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.java:103)</div><div>        at org.keycloak.models.jpa.JpaRealmProviderFactory.create(JpaRealmProviderFactory.java:34)</div><div>        at org.keycloak.models.jpa.JpaRealmProviderFactory.create(JpaRealmProviderFactory.java:16)</div><div>        at org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.java:103)</div><div>        at org.keycloak.models.cache.infinispan.DefaultCacheRealmProvider.getDelegate(DefaultCacheRealmProvider.java:59)</div><div>        at org.keycloak.models.cache.infinispan.DefaultCacheRealmProvider.getRealm(DefaultCacheRealmProvider.java:161)</div><div>        at org.keycloak.services.managers.ApplianceBootstrap.setupDefaultRealm(ApplianceBootstrap.java:32)</div><div>        at org.keycloak.services.resources.KeycloakApplication.&lt;init&gt;(KeycloakApplication.java:81)</div><div>        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)</div><div>        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)</div><div>        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)</div><div>        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)</div><div>        at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:148)</div><div>        ... 19 more</div><div>Caused by: javax.naming.NameNotFoundException: datasources/KeycloakDS -- service jboss.naming.context.java.jboss.datasources.KeycloakDS</div><div>        at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:106)</div><div>        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:207)</div><div>        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:184)</div><div>        at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:237)</div><div>        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:193)</div><div>        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:189)</div><div>        at javax.naming.InitialContext.lookup(InitialContext.java:417)</div><div>        at javax.naming.InitialContext.lookup(InitialContext.java:417)</div><div>        at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.getConnection(DefaultJpaConnectionProviderFactory.java:202)</div><div>        ... 35 more</div></div></div>