I have persistence-context.xml in backend jar but all the entities in seperate JAR. Inside persistence-context.xml I reference this jar (persistence-unit.jar).
<persistence> <persistence-unit name="smarthome"> <jta-data-source>java:/DefaultDS</jta-data-source> <jar-file>C:/tools/jboss/jboss-4.0.4.GA/server/default/deploy/persistence-unit-1.0-SNAPSHOT.jar</jar-file> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/> <property name="hibernate.hbm2ddl.auto" value="update"/> </properties> </persistence-unit> </persistence>