[jboss-user] [EJB 3.0] New message: "Re: Nested DataSource fails to deploy before ejbs"

jaikiran pai do-not-reply at jboss.com
Tue Feb 16 14:19:45 EST 2010


User development,

A new message was posted in the thread "Nested DataSource fails to deploy before ejbs":

http://community.jboss.org/message/526623#526623

Author  : jaikiran pai
Profile : http://community.jboss.org/people/jaikiran

Message:
--------------------------------------------------------------
There's the jboss.xml (for ejb jar files) where you can add dependencies per bean (i.e. a bean can be configured to depend on something else through the use of <depends>). But since you mention that it's the persistence.xml which requires this datasource, then you can just add this dependency in your persistence.xml. See this http://www.jboss.org/file-access/default/members/jbossejb3/freezone/docs/reference/1.0.7/html/entityconfig.html which explains about:
 
jboss.depends.{some arbitrary name} - Specify an MBean dependency for the persistence unit deployment. 
 
So you can use:
 
<?xml version="1.0" encoding="UTF-8"?>
<persistence 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"
   version="1.0">
   <persistence-unit name="...">
      <jta-data-source>java:/DefaultDS</jta-data-source>
      ...
      <properties>
            ... 
          <property name="jboss.depends.1" value="jboss.test:service=YetAnotherDependedOn"/>
      </properties>
   </persistence-unit>
</persistence>


--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/526623#526623




More information about the jboss-user mailing list