JPA 2.x packaging : persistence units referencing other jar files using jar-file in JBoss EAP
Issue
- I am trying to deploy an EAR with a a layout like the following:
app.ear
/lib/persistenceUnit.jar
/META-INF/persistence.xml
/web.war
/WEB-INF/lib/web-entities.jar
/other-entities.jar
The persistence.xml includes the following
<jar-file>../other-entities.jar</jar-file>
<jar-file>../web.war/WEB-INF/lib/web-entities.jar</jar-file>
When attempting to persist an entity (e.g. com.example.web.Entity) contained within web-entities.jar, the following error occurs:
Unknown entity: com.example.web.Entity
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7.x
- 6.x
- Java Persistence API (JPA) 2.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.