Is it possible to add the entity jar with the jar-file tag within the persistence.xml?

Solution Unverified - 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

    • 6.x
  • 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.