Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] eclipselink doesn't find my persistence.xml

Steffen,
    Your persistence.xml should be at the root of where your entities are, in an EE ear you can still place it off your ejb.jar for container managed apps and off of the web.war for application managed apps - all off of the META-INF directory.

You can use <jar-file> or a MANIFEST.MF entry when you package your entities in a separate jar
1) use
<jar-file>org.eclipse.persistence.example.jpa.server.entities.jar</jar-file>

2) or a manifest entry at the root of the jar containing or using this persistence.xml will suffice
In this case this MANIFEST.MF entry is beside the persistence.xml in the ejb.jar of an EAR
Manifest-Version: 1.0
Class-Path: APP-INF/lib/eclipselink.jar
 org.eclipse.persistence.example.jpa.server.entities.jar

>here is an example
http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebSphere7_Web_Tutorial#MANIFEST.MF

    thank you
    /michael

Steffen Förster wrote:

Hello there I'm new here.

I am using EL nightly 20100604 under jdk1.6_20. If I start my programm directly through Eclipse it works fine.
When I start the jar of this programm it doesn't find the persistence.xml outside (but in the classpath).

Some more information:
PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML is set to the canonical path of the file.
The file must be out of the jar, because it should be rebuilt before EL starts.

I figured out, that the PersistenceUnitProcessor calls loader.getResources(descriptorPath). It returns almost the right, but index of the CompoundEnumeration is set to 2. So EL ignores the PU entries of my file and I get a PersistenceException "No Persistence provider for EntityManager named"

Has anyone an idea what to do? Should I file a bug?


_______________________________________________ eclipselink-users mailing list eclipselink-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top