I was having a hard time getting <jar-file> to work in persistence.xml, so wondering if it has been implemented. I did not see any test for it in Hibernate EntityManager.
Basically I have a domain.jar which contains my annotated domain entities. I have two other jars - application.jar and test.jar, that try to access the entities in domain.jar. These two jars package their own persistence.xml files which use <jar-file> to reference domain.jar:
Code:
<jar-file>domain.jar</jar-file>
However I get the following exception:
java.lang.IllegalArgumentException: Cannot parse persistence unit from class path resource [.../persistence.xml]
caused by
java.io.FileNotFoundException: class path resource [domain.jar] cannot be resolved to URL because it does not exist
I know domain.jar is in the class path. Should I be specifying it differently? Is this supposed to work in a J2SE environment or is this strictly for JavaEE environment>
Thanks.
Naresh