users@glassfish.java.net

Re: Error deploying web app using JPA

From: Sahoo <Sahoo_at_Sun.COM>
Date: Tue, 03 Jul 2007 10:21:29 +0530

glassfish_at_javadesktop.org wrote:
> Thanks. That helped! I must have picked up the META-INF/persistence.xml path from some bad example on the Internet. One more thing I had to do was specify the unitName in the @PersistenceContext annotation, as it was defaulting to <mybean_qualified_name>/em.
>
No, unitName in @PersistenceContext does not default to
<mybean_qualified_name>/em. unitName is optional if there is only one
PersistenceUnit in the scope of the component. You must have packaged
more than one persistence.xml files in the war or defined more than one
persistence-units in the persistence.xml.

-- Sahoo