<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">I get transaction rollback errors frequently. Every time I leave the application idle for a few minutes and come back, the system has transaction errors. I have to refresh multiple times for the keycloak admun-ui to start responding again. I realized my settings were using local database transactions and that does not work well. I am using JBOSS and J2EE so I definitely want to use the container managed transactions. I switched the settings in my management console and changed my persistence.xml to this:</span><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px"><div><persistence xmlns="<a href="http://java.sun.com/xml/ns/persistence" target="_blank">http://java.sun.com/xml/ns/persistence</a>"</div><div>
xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"</div><div> xsi:schemaLocation="<a href="http://java.sun.com/xml/ns/persistence" target="_blank">http://java.sun.com/xml/ns/persistence</a> <a href="http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" target="_blank">http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd</a>"</div>
<div> version="1.0"></div><div> <persistence-unit name="jpa-keycloak-identity-store" transaction-type="JTA"></div><div> <jta-data-source>java:jboss/datasources/ui_users</jta-data-source></div>
<div> <class>org.keycloak.models.jpa.entities.ApplicationEntity</class></div><div> <class>org.keycloak.models.jpa.entities.CredentialEntity</class></div><div> <class>org.keycloak.models.jpa.entities.OAuthClientEntity</class></div>
<div> <class>org.keycloak.models.jpa.entities.RealmEntity</class></div><div> <class>org.keycloak.models.jpa.entities.RequiredCredentialEntity</class></div><div> <class>org.keycloak.models.jpa.entities.ApplicationRoleEntity</class></div>
<div> <class>org.keycloak.models.jpa.entities.RealmRoleEntity</class></div><div> <class>org.keycloak.models.jpa.entities.SocialLinkEntity</class></div><div> <class>org.keycloak.models.jpa.entities.UserEntity</class></div>
<div> <class>org.keycloak.models.jpa.entities.UserRoleMappingEntity</class></div><div> <class>org.keycloak.models.jpa.entities.ScopeMappingEntity</class></div><div><br></div><div> <exclude-unlisted-classes>true</exclude-unlisted-classes></div>
<div><br></div><div> <properties></div><div> </div><div> <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServer2008Dialect"/> </div><div> <property name="hibernate.hbm2ddl.auto" value="update"/></div>
<div> </div><div> </properties></div><div> </persistence-unit></div><div></persistence></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><b>Now when I start the server I get the following error:</b></div>
<div><br></div><div><div> java.lang.NullPointerException</div><div><span style="white-space:pre-wrap">        </span>at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:76)</div><div><span style="white-space:pre-wrap">        </span>at </div>
<div>.</div><div>.</div><div>.</div><div>org.keycloak.models.jpa.JpaKeycloakSessionFactory.createSession(JpaKeycloakSessionFactory.java:21)</div><div><span style="white-space:pre-wrap">        </span>at </div><div>.</div><div>.</div>
<div>.</div><div>jboss.undertow.deployment.default-server.default-host./auth: Failed to start service</div><div> Caused by: java.lang.RuntimeException: Failed to construct public org.keycloak.server.KeycloakServerApplication(javax.servlet.ServletContext) throws java.io.FileNotFoundException</div>
</div><div><br></div><div>Any ideas why this is happening?</div><div><br></div><div>Thanks,</div><div><br></div><div>Dean Peterson</div></div></div>