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