users@glassfish.java.net

Re: Autodiscovery of JPA classes

From: Sahoo <Sahoo_at_Sun.COM>
Date: Thu, 11 Sep 2008 02:13:23 +0530

That's likely to be a bug. The JPA spec expects relative path to work.
Send the stack trace. Also, try with toplink essentials, which is the
default provider in GlassFish and let us know whether that works or not.
If that works, then it's likely to be a bug in Hibernate.

Thanks,
Sahoo

Jose Noheda wrote:
> 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
> <mailto: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
> <mailto:users-unsubscribe_at_glassfish.dev.java.net>
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
> <mailto:users-help_at_glassfish.dev.java.net>
>
>