users@glassfish.java.net

Re: Autodiscovery of JPA classes

From: Jose Noheda <jose.noheda_at_gmail.com>
Date: Wed, 10 Sep 2008 22:22:40 +0200

Thank you very much, /WEB-INF/lib/model.jar worked! Relative paths fail with


Caused by: java.net.MalformedURLException: PWC1222: Path lib/model.jar does
not start with a "/" character

though.

Regards

On Wed, Sep 10, 2008 at 9:58 PM, Sahoo <Sahoo_at_sun.com> wrote:

> Autodiscovery of entity classes is limited to a PU root only. if you keep
> your persistence.xml in WEB-INF/classes/META-INF directory, then you have to
> add WEB-INF/lib/*.jar in persistence.xml to the list of jar files to be
> searched for classes. Use <jar-file> element in your persistence.xml. e.g.,
> <jar-file>../lib/additional-entities.jar</jar-file>
>
> Thanks,
> Sahoo
>
>
> Jose Noheda wrote:
>
>> Hi,
>>
>> When deploying to Glassfish including a persistence.xml in the WAR file
>> (inside META-INF) only the WEB-INF/classes are discovered by Hibernate. If I
>> place it in a JAR (later included inside WEB-INF/lib) only the jar classses
>> are correctly detected. Is there any way to load both?
>>
>> Regards
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>