GlassFish can't find persistence provider for EntityManager
Posted
by Xorty
on Stack Overflow
See other posts from Stack Overflow
or by Xorty
Published on 2010-06-12T16:33:00Z
Indexed on
2010/06/12
16:43 UTC
Read the original article
Hit count: 493
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).
© Stack Overflow or respective owner