[jboss-user] [EJB 3.0] - Re: Reference-Problems within an ear

Hilwi do-not-reply at jboss.com
Sun Apr 13 11:55:14 EDT 2008


Thank you for your help! It works this way!

With these different jars I wanted to divide my application into different modues. If I have to create another application with different features I want to assemble these different modules in a new ear. In this case it's not easy to decide in which jar I have to place my persistence.xml.

I created another ejb-jar named OpenJbs_EJB.jar now that only contains the persistence.xml with the jar-files to scan:


  | <?xml version="1.0" encoding="UTF-8"?>
  | <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
  |   <persistence-unit name="jabusuite" transaction-type="JTA">
  |     <provider>org.hibernate.ejb.HibernatePersistence</provider>
  |     <jta-data-source>java:/JaBuSuiteDS</jta-data-source>
  |     <!--<exclude-unlisted-classes>false</exclude-unlisted-classes>-->
  |     
  |     <jar-file>../JbsCore.jar</jar-file>
  |     <jar-file>../JbsCalendar.jar</jar-file>
  |     
  |     <properties>
  |       <property name="hibernate.hbm2ddl.auto" value="update"/>
  |     </properties>
  |   </persistence-unit>
  | </persistence>
  | 

The application.xml:


  | <?xml version="1.0" encoding="UTF-8"?>
  | <application version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
  |   <display-name>OpenJbs_Server</display-name>
  |   <module>
  |     <ejb>JbsCore.jar</ejb>
  |   </module>
  |   <module>
  |     <ejb>JbsCalendar.jar</ejb>
  |   </module>
  |   <module>
  |     <ejb>OpenJbs_EJB.jar</ejb>
  |   </module>
  |   <module>
  |     <web>
  |       <web-uri>JaBuSuite_Webclient.war</web-uri>
  |       <context-root>/JaBuSuite_Webclient</context-root>
  |     </web>
  |   </module>
  | </application>
  | 

This seems not to be a very clean solution to me because the OpenJbs_EJB.jar is just a dummy. Isn't it possible to put the persistence.xml elsewhere?

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

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



More information about the jboss-user mailing list