Hello!
I'm trying to make a
test project with JEE6 in Glassfish and I'm getting an error related to my persistence unit:
That's my persistence.xml
-------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.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_2_0.xsd">
<persistence-unit name="VuelosWebPersistenceUnit" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<properties>
<property name="eclipselink.target-database" value="DERBY" />
<property name="eclipselink.ddl-generation" value="create-tables" />
<property name="eclipselink.logging.level" value="FINE" />
<property name="eclipselink.jdbc.url" value="jdbc:derby://localhost:1527/dbname" />
<property name="eclipselink.jdbc.user" value="user" />
<property name="eclipselink.jdbc.password" value="pwd />
</properties>
</persistence-unit>
</persistence>
-------------------------------
My SLSB has this conflicting code:
...
@PersistenceContext
EntityManager em;
...
I tried too with this code
...
@PersistenceContext(name="VuelosWebPersistenceUnit", unitName="VuelosWebPersistenceUnit")
EntityManager em;
...
with the same result.
The error is this one:
Unable to retrieve EntityManagerFactory for unitName VuelosWebPersistenceUnit
And my persistence.xml file is in this path ${warfile}/META-INF/persistence.xml
Any ideas what's my problem or how to solve it?
Thank you very much!
antonio>