Note that we're using Spring Boot's 2.2.6.RELEASE version here. The dependencies spring-boot-starter-data-jpa and H2 have been added for persistence. The other springframework.boot dependencies are for web support, as we also need to be able to run the Keycloak authorization server as well as admin console as web services.

As we can see here, we first configured Keycloak as a JAX-RS application with KeycloakServerProperties for persistent storage of Keycloak properties as specified in our realm definition file. We then added a session management filter and mocked a JNDI environment to use a spring/datasource, which is our in-memory H2 database.

5. KeycloakServerProperties

Now let's have a look at the KeycloakServerProperties we just mentioned:

The Authorization Server runs okay on port 8083 with the given code. If you upgrade the Boot version to 2.2.3 or above, you’ll indeed see this error, which is a bug reported to Keycloak: https://issues.redhat.com/browse/KEYCLOAK-13249 It’s marked as fixed in version 9.0.1 so you can try upgrading the Keycloak libraries to that version, though there may be other changes as well.

Alternatively, you can keep the 2.2.2 Boot version for the application.

Hi Bill, I’m not able to reproduce the issue on our code here: https://github.com/Baeldung/spring-security-oauth/tree/master/oauth-rest/oauth-authorization-server I suggest trying to run it as it is, and if it’s working ok, then there may be some missing library related to SQL Server. Another possible cause is if you’re running this with a different Java version (the github code uses Java 13). Unfortunately, we can only help with questions that are specifically and directly related to the article – not with your own, custom application. StackOverflow is a great place to ask more general questions. Cheers.