Baeldung/spring-security-oauth

NullPointerException with Keycloak 14.0

srinivaskakarala opened this issue · 1 comments

I am trying to upgrade to keycloak 14 and 3.15.1.Final of resteasy, 11.0.9.Final of infinispan. The application fails to start and I get a null pointer exception.

Couldn't create keycloak master admin user: {}
java.lang.NullPointerException: null
at java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011) ~[?:?]
at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1006) ~[?:?]
at org.keycloak.executors.DefaultExecutorsProviderFactory.getExecutor(DefaultExecutorsProviderFactory.java:113) ~[keycloak-services-14.0.0.jar!/:14.0.0]
at org.keycloak.executors.DefaultExecutorsProviderFactory$1.getExecutor(DefaultExecutorsProviderFactory.java:68) ~[keycloak-services-14.0.0.jar!/:14.0.0]
at org.keycloak.utils.ServicesUtils.timeBoundOne(ServicesUtils.java:71) ~[keycloak-services-14.0.0.jar!/:14.0.0]
at org.keycloak.storage.AbstractStorageManager.mapEnabledStorageProvidersWithTimeout(AbstractStorageManager.java:135) ~[keycloak-services-14.0.0.jar!/:14.0.0]
at org.keycloak.storage.UserStorageManager.getUsersCount(UserStorageManager.java:374) ~[keycloak-services-14.0.0.jar!/:14.0.0]
at org.keycloak.models.cache.infinispan.UserCacheSession.getUsersCount(UserCacheSession.java:545) ~[keycloak-model-infinispan-14.0.0.jar!/:14.0.0]
at org.keycloak.storage.user.UserQueryProvider.getUsersCount(UserQueryProvider.java:52) ~[keycloak-server-spi-14.0.0.jar!/:14.0.0]
at org.keycloak.services.managers.ApplianceBootstrap.createMasterRealmUser(ApplianceBootstrap.java:99) ~[keycloak-services-14.0.0.jar!/:14.0.0]
at xxxx.xxxx.xxx.EmbeddedKeycloakApplication.createMasterRealmAdminUser(EmbeddedKeycloakApplication.java:60) ~[classes!/:1.7-phase3-SNAPSHOT]
at xxx.xxx.xxx.EmbeddedKeycloakApplication.(EmbeddedKeycloakApplication.java:40) ~[classes!/:1.7-phase3-SNAPSHOT]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]
at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:152) ~[resteasy-jaxrs-3.15.1.Final.jar!/:3.15.1.Final]
at org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2835) ~[resteasy-jaxrs-3.15.1.Final.jar!/:3.15.1.Final]
at org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:376) ~[resteasy-jaxrs-3.15.1.Final.jar!/:3.15.1.Final]
at org.jboss.resteasy.spi.ResteasyDeployment.startInternal(ResteasyDeployment.java:288) ~[resteasy-jaxrs-3.15.1.Final.jar!/:3.15.1.Final]
at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:98) ~[resteasy-jaxrs-3.15.1.Final.jar!/:3.15.1.Final]
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:140) ~[resteasy-jaxrs-3.15.1.Final.jar!/:3.15.1.Final]
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:42) ~[resteasy-jaxrs-3.15.1.Final.jar!/:3.15.1.Final]
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1134) ~[tomcat-embed-core-9.0.37.jar!/:9.0.37]
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:986) ~[tomcat-embed-core-9.0.37.jar!/:9.0.37]
at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedContext.load(TomcatEmbeddedContext.java:82) ~[spring-boot-2.3.3.RELEASE.jar!/:2.3.3.RELEASE]
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?]
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654) ~[?:?]

As for now we run on 11.0.2. But of course, we should update the version in the future.