title: Configure persistence units to be available in several jars of an ear
body: <p>In a .ear file, my EJBs are copied in several jar and war for some technical constraints. And only one of these jar contains the persistence.xml file where I have configured several persistence units.</p>
  
  <pre><code>myear.ear
  |---- myjar1.jar
  |-------- META-INF/persistence.xml
  |---- myjar2.jar
  |---- mywar.war
  </code></pre>
  
  <p>The problem is Jboss cannot find the persistence configuration for the classes within the jar "myjar2" and the war :</p>
  
  <blockquote>
    <p>Could not get class configuration for ....EjbA.class due to the following errors: Can't find a deployment unit named xxxxx at
    subdeployment "jar2.jar" of deployment "myear.ear"</p>
  </blockquote>
  
  <p>To resolve that, I tried to create a new jar containing only the persistence.xml file but it doesn't work.</p>
  
  <p>Any idea of how I could share my persistence.xml file to every jar without reorganising all my ear archive?</p>