[jboss-user] [EJB 3.0] - Re: Single persistence.xml file with multiple EJB jars

DeanoUK do-not-reply at jboss.com
Thu Apr 3 10:55:37 EDT 2008


"jaikiran" wrote : Okay in that case, probably you can place the persistence.xml in the META-INF folder of any one of the ejb jars. Let's assume you placed it in msp1_ejb.jar. The persistence.xml can then contain this:
  | 
  | <?xml version="1.0" encoding="UTF-8"?>
  |   | <persistence xmlns="http://java.sun.com/xml/ns/persistence">
  |   | 	<persistence-unit name="msp-par">
  |   | 		<jta-data-source>java:/@deployeddatabase@</jta-data-source>
  |   | 		<jar-file>../</jar-file>
  |   | 		<jar-file>../../msp2_ejb.jar</jar-file>
  |   | 		<properties>
  |   | 			<property name="hibernate.hbm2ddl.auto" value="false"/>
  |   | 			<property name="com.intellij.javaee.persistence.datasource" value="Datasource"/>
  |   | 		</properties>
  |   | 	</persistence-unit>
  |   | </persistence>
  | 
  | 
  | This way both the ejb jar files will be scanned for the entities. I tried this scenario on my local setup of JBoss-4.2.2 and this seems to be working. It picked up the entities that were spread across (and not replicated) the 2 ejb jars. Try it out and see if it works for you.
  |    


Sorry its taken so long to reply.
This is exactly what we've tried before - but it still produces the same problem. 
i.e. we get:


  | --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
  | ObjectName: persistence.units:unitName=msp-par
  |   State: NOTYETINSTALLED
  | 

But without any actual error within the console output.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4141385#4141385

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4141385



More information about the jboss-user mailing list