users@glassfish.java.net

Re: Error deploying web app using JPA

From: Sahoo <Sahoo_at_Sun.COM>
Date: Mon, 02 Jul 2007 11:15:37 +0530

There must be a persistence.xml file in the WEB-INF/lib/*.jar. META-INF/persistence.xml is not the right place to package persistence.xml in a war, so it being ignored by GlassFish. You should package it as WEB-INF/classes/META-INF/persistence.xml or META-INF/persistence.xml in any of jar in WEB-INF/lib/.

-- Sahoo

glassfish_at_javadesktop.org wrote:
> There's only one persistence.xml in the war. I unzipped the file just to make sure.
>
> [code]
> $ jar -tf StocksWeb.war|grep persistence.xml
> META-INF/persistence.xml
> [/code]
>
> I've noticed that I can change the name attribute of persistence-unit to whichever value, but it gives the same error. It's as if the persistence.xml is not even being read.
> [Message sent by forum member 'fawad' (fawad)]
>
> http://forums.java.net/jive/thread.jspa?messageID=224855
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>