Hi Cay,
Welcome back in GlassFish forum!
As per JPA 1.0 spec (section #6.2), the valid places to package your
persistence.xml in a war file are:
a) WEB-INF/classes/META-INF directory,
b) META-INF directory of a jar file in the WEB-INF/lib directory of a
WAR file.
For #a and #b, the /persistence unit root/ is WEB-INF/classes or the
jar file respectively. The /persistence unit root/ is used during
discovery of JPA domain classes, so it is important to know. The spec
has more information on this.
Going by the above description,
war-root/WEB-INF/classes/META-INF/persistence.xml is the right answer.
war-root/META-INF/persistence.xml should not be picked up by the server
unless there has been a change in JPA 2.0 (work in progress spec) that I
am not aware of.
Thanks,
Sahoo
glassfish_at_javadesktop.org wrote:
> I know it seems like a v2 message, but I am quite sure it came out of v3. The good news is that after restarting the server it went away.
>
> But I am still baffled by where I should put persistence.xml. The sample that I can now successfully deploy puts it in two places: META-INF and WEB-INF/classes/META-INF.
>
> From fussing with it, it seems to me that WEB-INF/classes/META-INF is where it needs to be, but I'd like to get an independent confirmation. (It does seem a bizarre place.)
>
> Thanks,
>
> Cay
> [Message sent by forum member 'cayhorstmann' (cayhorstmann)]
>
> http://forums.java.net/jive/thread.jspa?messageID=329549
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>