users@glassfish.java.net

Re: Error resolving persistence context

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Thu, 20 Dec 2012 12:03:17 -0800

Fixed a typo in my reply...

On 12/20/12 12:00 PM, Marina Vatkina wrote:
> Laird,
>
> If you are using EJBContainer API, add this JVM property to your java
> command: org.glassfish.ejb.embedded.keep-temporary-files=true and the
> files created by the EJB container will be left behind.
>
> In the latest GF this property is propagated to the GF runtime as well.
>
> -marina
> On 12/20/12 11:24 AM, Laird Nelson wrote:
>> If I have a META-INF/persistence.xml with a persistence unit defined
>> within it named "cx", and if in an EJB module somewhere I have this:
>>
>> @PersistenceContext(name = "cx")
>>
>> ...and there are no XML deployment descriptors doing any kind of
>> overriding, and I'm still getting the following error:
>>
>> Could not resolve a persistence unit corresponding to the
>> persistence-context-ref-name [cx] in the scope of the module...
>>
>> ...what does that mean? What else should I be verifying?
>>
>> This is with embedded GlassFish version 3.1.1. I have logging on
>> javax.enterprise, com.sun.enterprise and org.glassfish dialed up to
>> FINEST. The amount of verbiage is truly stunning, but no log output
>> indicates what is wrong. I do see the low-level XML parsing routines
>> successfully parsing my persistence.xml and finding the persistence
>> unit named "cx", so at least at that point it is known to the system.
>>
>> Is there some way to get embedded GlassFish to output a
>> server.logthat would contain something besides what is barfed to the
>> screen? Is there some way to get embedded GlassFish to leave its
>> temporary directory behind? Maybe there's something wrong with the
>> EJB module itself?
>>
>> Thanks,
>> Laird
>>
>> --
>> http://about.me/lairdnelson
>