users@glassfish.java.net

Re: Could not resolve a persistence unit in EAR

From: Sahoo <sahoo_at_sun.com>
Date: Tue, 27 Apr 2010 18:15:13 +0530

Are there multiple persistence.xml files in the scope of
XXX-comp-firmenmgmt-0.0.1-SNAPSHOT.jar? If yes, then specify unitName in
@PersistenceContext. BTW, why have you specified name = "xxx" in
@PersistenceContext?

I also fail to understand why you package your entities as part of ejb
jars? Should they not be part of lib/pu.jar so that they are visible to
both the ejb-jars? I have a feeling once you get past your current
deployment problem, you shall run into class loading problems because of
the way you have packaged your app. Anyway, first fix the deployment
problem.

Sahoo

glassfish_at_javadesktop.org wrote:
> Hi have a lots of problems while deploy my application
>
> Glassfish: GlassFish v3 (build 74.2) (same on: GlassFish 3 (build 14))
> JPA 2.0, EJB 3.0
> JPA Provider: Hibernate
>
>
> Error:
> Exception while preparing the app : org.glassfish.deployment.common.DeploymentException: Could not resolve a persistence unit corresponding to the persistence-context-ref-name [xxx] in the scope of the module called [XXX-ear-0.0.1-SNAPSHOT#XXX-comp-firmenmgmt-0.0.1-SNAPSHOT.jar]. Please verify your application.
>
> My Application is packed as an EAR-File:
>
> ear
> + lib
> -- some libs
> -- pu.jar (with META-INF Folder - persistence.xml)
> xxx-comp-firmenmgmt-0.0.1-SNAPSHOT.jar (with Entites and EJBs)
> xxx-comp-projektmgmt-0.0.1-SNAPSHOT.jar (with Entites and EJBs)
> +META-INF
> -- application.xml
>
> The References from my Beans look like
> " @PersistenceContext(name = "xxx") "
>
> my persistence.xml look like:
> <persistence-unit name="xxx">
> <provider>org.hibernate.ejb.HibernatePersistence</provider>
> <jta-data-source>jdbc/xxx</jta-data-source>
> <jar-file>../xxx-comp-firmenmgmt-0.0.1-SNAPSHOT.jar</jar-file>
> <jar-file>../xxx-comp-projektmgmt-0.0.1-SNAPSHOT.jar</jar-file>
> <exclude-unlisted-classes>false</exclude-unlisted-classes>
> <properties>
> <property name="eclipselink.ddl-generation" value="create-tables" />
> <property name="eclipselink.ddl-generation.output-mode" value="database" />
> <property name="eclipselink.logging.level" value="OFF" />
>
> <property name="hibernate.hbm2ddl.auto" value="update" />
> <property name="hibernate.show_sql" value="false"></property>
> </properties>
> </persistence-unit>
> </persistence>
>
>
> try a lots of different declarations and positions of the persistence.xml but nothing work
> Hope somebody have any good idea
>
> thanks a lot
> Dom
> [Message sent by forum member 'dadidom']
>
> http://forums.java.net/jive/thread.jspa?messageID=399204
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>