users@glassfish.java.net

Re: Glassfish V3 - Could not resolve persistence unit....

From: Sahoo <Sahoo_at_Sun.COM>
Date: Thu, 07 Jan 2010 07:54:22 +0530

I actually tried a very similar example in v3 and it worked for me. I
tried the sample available at
http://weblogs.java.net/blog/ss141213/archive/2005/12/using_java_pers.html.

May be you can share a test case with us to debug further?

Thanks,
Sahoo

glassfish_at_javadesktop.org wrote:
> I seem to be having yet another problem deploying my application on Glassfish V3 (which deploys fine on V2.1). It would seem that my EJB project cannot find the persistence units defined in my JPA project.
>
> My EAR file looks like this:
>
> [code]
> Foo-ear.ear -
> lib\
> Foo-jpa.jar
> Foo-ejb.jar
>
> [/code]
>
> Error: Could not resolve a persistence unit corresponding to the persistence-context-ref-name [com.stuff.Foo/entityManager] in the scope of the module called [Foo-ear#Foo-ejb.jar]. Please verify your application.
>
> In my persistence.xml I have a persistence unit defined:
>
> [code]
> <persistence-unit name="Foo-appserv">
> [/code]
>
> And in my Foo class I have:
>
> [code]
> @PersistenceContext(unitName = "Foo-appserv")
> private EntityManager entityManager;
> [/code]
>
> Once again this set up deploys fine in Glassfish v2.1 so I have no idea why it doesn't work with V3.
> [Message sent by forum member 'cain05' (cain05_at_gmail.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=379061
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>