I am running Spring 3 + Hibernate 4 jpa and mysql successfully if i deploy war inside tomcat 7 but If I deploy same war inside Tomee plus 1.7.2 then I get following exception.
Caused by: java.lang.ClassNotFoundException: org.hibernate.cache.QueryResultsRegion
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.tomee.catalina.LazyStopWebappClassLoader.loadClass(LazyStopWebappClassLoader.java:171)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
I find that this class is part of hibernate 3.3
but I am using hibernate 4.2
.
I copied hibernate-core-4.2.0.Final.jar, hibernate-ehcache-4.2.0.Final.jar,cglib-2.2.2.jar,hibernate-jpa-2.0-api-1.0.1.Final.jar,hibernate-commons-annotations-4.0.1.Final.jar,hibernate-entitymanager-4.2.0.Final.jar,hibernate-validator-4.2.0.Final.jar,ehcache-core-2.4.3.jar,spring-data-commons-core-1.3.0.RELEASE.jar,spring-data-jpa-1.1.0.RELEASE.jar,spring-jdbc-3.0.7.RELEASE.jar,spring-orm-3.1.2.RELEASE.jar to /lib folder also. These jars also part of war.
persistence.xml
is:
<persistence-unit name="default" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider>
</persistence-unit>