My persistence.xml is located in A.jar and entity classes are in B.jar. When trying to create a query using entity manager (from A.jar), I got exception saying it cannot find NamedQueries. However, named queries are listed on the entity class using annotation.
Tried to use <jar-file/>
to include B.jar in persistence.xml, but it doesn't work. Here's what I've tried.
<persistence>
<persistence-unit name="myapp">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/DefaultDS</jta-data-source>
<properties>
... ...
</properties>
<jar-file>lib/B.jar</jar-file>
<jar-file>../lib/B.jar</jar-file>
<jar-file>WEB-INF/lib/B.jar</jar-file>
<jar-file>B.jar</jar-file>
<class>com.mypackage.Bar</class>
<class>com.mypackage.Foo</class>
</persistence-unit>
</persistence>