Skip to content

GWT Integration Hibernate Entity Manager

apetrelli edited this page Apr 27, 2013 · 3 revisions

The gwt-integration-hibernate-entitymanager library helps with the integration of GWT with the JPA implementation provided by Hibernate.

The problems

The solutions

In some application servers, Hibernate is not assigned as the JPA persistence provider

The problem: When using some application server that provided a JPA implementation (e.g. with Oracle Weblogic), if you are including Hibernate Entity Manager as an external JPA persistence provider, it cannot be used as the persistence provider at all.

The solution: Use a servlet listener that initializes JPA to load Hibernate as persistence provider.

Simply add the following piece of code in your web.xml file:

<listener>
	<display-name>hibernate-init</display-name>
	<listener-class>com.github.apetrelli.gwtintegration.hibernate.entitymanager.web.HibernateInitContextListener</listener-class>
</listener>