GlassFish can't find persistence provider for EntityManager
- by Xorty
Hi, I am building Spring MVC project (2.5). It runs on GlassFish v3 server and I am using Hibernate for ORM mapping from Derby database.
I am having trouble with deployment - GlassFish says : No Persistence provider for EntityManager named mvcspringPU.
Here is how I create EntityManagerFactory :
emf = Persistence.createEntityManagerFactory("mvcspringPU");
And here is my configuration file persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="mvcspringPU" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>CarsDB</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update"/>
</properties>
</persistence-unit>
</persistence>
I am building with NetBeans 6.8, so things like build paths should be alright (generated by IDE itself).