JPA 2.0 packaging : persistence units referencing other jar files using jar-file in JBoss EAP 6

Solution Unverified - Updated -

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 references:

<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) 6.x
Java Persistence API (JPA) 2.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.