HIBERNATE JPA:How to deploy a WAR created by Netbeans on a Standalone TOMCAT

HIBERNATE JPA:

How to deploy a WAR created by Netbeans on a Standalone TOMCAT

Years ago TOMCAT was a two-tailed cat, used as the logo for the mighty F-14A Tomcat plane, when I became mature O_o, Tomcat lost a tail, landed on the ground and now is a well know Servlet Container... I think it lost part of its magic during the landing, and a tail too.

Tomcat: Hardware embedded version.


During compilation of a web project using hibernate with Netbeans, it copies persistence.xml to a new folder named META-INF under the WEB-INF/classes folder. So if you are having trouble launching your application once it is deployed on TOMCAT and getting the error:

javax.persistence.PersistenceException: No Persistence provider for EntityManager named ...

Most probably Hibernate is not finding persistence.xml in WEB-INF/classes/META-INF/persistence.xml when deployed under TOMCAT.

Copy it by hand from 'conf' folder to WEB-INF/classes/META-INF.

And salute me!


Comments

Popular posts from this blog

Qt Signals and Slots, Connecting and Disconnecting

Vaadin 7: Detect Enter Key in a TextField

JAVA JPA WITH HIBERNATE AND H2 Tutorial