JPA 2.x packaging : persistence units referencing other jar files using jar-file in JBoss EAP

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)
    • 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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content