Deploying Keycloak In TomEE

We would be using apache-tomee-plus-1.7.1 and Keycloak 1.1.0.Beta2

Refer this blog first Deploying Keycloak In Tomcat

Step 1: Configure TomEE for Hibernate instead of OpenJPA

Follow the guidelines here  to configure Hibernate



Step 2 : Configure TomEE with DataSource

Follow the guidelines here  and here to configure datasource

Since we would be using H2 database, copy h2-1.3.176.jar to TOMEE_HOME/lib

Modify the TOMEE_HOME/conf/tomee.xml as follows


Step 3 : Configure the Keycloak Server

Download the keycloak-server from github

Change the datasource name as follows

For TomcatEE external JNDI name starts with java:comp (Not  java:comp/env as is Pure Tomcat)


Deploy to TomEE and start the server, you would get the following error


Step 4 : Fix the issues

Create the policyConfgi.xml as follows


Step 5 : Have fun

Login to app with admin/admin



One thought on “Deploying Keycloak In TomEE

  1. Pingback: Deploying Keycloak In Tomcat | Craftsman Nadeem

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s