2 Replies Latest reply on Sep 26, 2006 3:12 PM by mtb2ride

    Multiple Depends

    mtb2ride

      This is Jboss 4.0.4.GA. I have a MBean deloyed in a sar. The MBean depends on 2 datasources deployed using the standard jboss datasource deployer file. Both datasources are in one file. There is no problem deploying the datsources. What's happening is jboss will try to load my sar, then determins that OracleDS is not laoded. Once OracleDS is loaded, the sar deployment proceeds, but AlarmOracleDS hasn't loaded yet.

      <server>
       <mbean code="com.mycompany.ua.undertaker.manager.jmx.UndertakerManager"
       name="mycompany.ua:service=UndertakerManager">
      
       <attribute name="Configs">loadtest/loadtestConfig.xml</attribute>
      
       <depends>jboss.jca:service=LocalTxCM,name=jdbc/AlarmOracleDS</depends>
       <depends>jboss.jca:service=LocalTxCM,name=jdbc/OracleDS</depends>
      
       </mbean>
      </server>


      09:37:20,781 DEBUG [UndertakerManager] Creating mycompany.ua:service=UndertakerManager
      09:37:20,781 DEBUG [UndertakerManager] Created mycompany.ua:service=UndertakerManager
      09:37:20,781 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/OracleDS' to JNDI name 'java:jdbc/OracleDS'
      09:37:20,781 DEBUG [UndertakerManager] Starting mycompany.ua:service=UndertakerManager
      
      --The other Datasource "AlarmOracleDS" is not bound yet, my code blows up, exceptions, stacktrace blah...blah
      
      --Then, after my code throws up:
      09:37:21,312 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/AlarmOracleDS' to JNDI name 'java:jdbc/AlarmOracleDS'
      


      Why is it not waiting for AlarmOracleDS to deploy?

        • 1. Re: Multiple Depends
          mtb2ride

          I found the <depends-list> element and tried it out, same result.



           <depends-list>
           <depends-list-element>jboss.jca:service=LocalTxCM,name=jdbc/AlarmOracleDS</depends-list-element>
           <depends-list-element>jboss.jca:service=LocalTxCM,name=jdbc/OracleDS</depends-list-element>
           </depends-list>
          


          • 2. Re: Multiple Depends
            mtb2ride

            CORRECTION

            Using <depends-list> fixed it!

            Problem solved!

            Thanks