Adding entity jar with the jar-file tag within the persistence.xml in JBoss EAP 6

Solution Verified - Updated -

Issue

  • There is an EAR application with EJB and hibernate entity classes with additional library of hibernate entity classes "entityJPA.jar". The problem is to tell the additional library classes, where their data source is. Following is directory structure of that application.
------- EAR structure -------
testProject.ear
|
|- META-INF
|   |- application.xml
|   |- jboss-deployment.structure.xml
|
|- testProjectJPA.jar
|   |
|   |- persistence.xml
|
|- lib
|   |
|   |- entityJPA.jar
------------------------------------
  • JBoss scans the JPA jar for the persistence.xml and recognizes the testProjectJPA.jar as JPA jar and handles the persistence unit.

  • Is it possible to add the entityJPA.jar with the <jar-file> tag within the persistence.xml, so that the entityJPA.jar classes are within the class path and can use the data source of the testProjectJPA.jar?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x
  • Java Persisteance API (JPA)
    • 2.0

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