[keycloak-user] Keycloak datasource problem

Bruno Oliveira bruno at abstractj.org
Mon Jul 25 09:59:55 EDT 2016


Hi Martin, do you have the datasource configured?

Based on this stacktrace:

> Caused by: javax.naming.NameNotFoundException: datasources/KeycloakDS --
> service jboss.naming.context.java.jboss.datasources.KeycloakDS
>

It looks like some datasource misconfiguration. Please, take a look at the docs
here[1] and double check all the steps if possible.

[1] - https://keycloak.gitbooks.io/server-installation-and-configuration/content/topics/database/datasource.html

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

> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user


--

abstractj
PGP: 0x84DC9914


More information about the keycloak-user mailing list