1 Reply Latest reply on Jan 18, 2005 5:00 PM by dheinecke

    depends question using hibernate service

    dheinecke

      I have written an mbean service that uses the hibernate mbean service. In order to make sure that the hibernate mbean gets loaded prior to my mbean, I am using the elements in the jboss-service.xml, but it does not seem to be working.

      Here is the jboss-service.xml for the hibernate mbean:

      <server>
       <mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateFactory,name=HibernateFactory">
       <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
       <attribute name="CacheProvider">net.sf.hibernate.cache.HashtableCacheProvider</attribute>
       <attribute name="Datasource">java:/DefaultDS</attribute>
       <attribute name="DefaultSchema">db2admin</attribute>
       <attribute name="Dialect">net.sf.hibernate.dialect.DB2Dialect</attribute>
       <attribute name="JndiName">java:/hibernate/EsmDatabaseFactory</attribute>
       <attribute name="MapResources">
       com/symantec/esm/data/Account.hbm.xml,
       com/symantec/esm/data/Agent.hbm.xml,
       com/symantec/esm/data/Domain.hbm.xml,
       com/symantec/esm/data/Job.hbm.xml,
       com/symantec/esm/data/Keyring.hbm.xml,
       com/symantec/esm/data/License.hbm.xml,
       com/symantec/esm/data/ManagerCertificate.hbm.xml,
       com/symantec/esm/data/Status.hbm.xml,
       com/symantec/esm/data/Sticky.hbm.xml
       </attribute>
       <attribute name="ShowSql">false</attribute>
       <attribute name="TransactionStrategy">net.sf.hibernate.transaction.JDBCTransactionFactory</attribute>
       <attribute name="UserTransactionName">UserTransaction</attribute>
       </mbean>
      </server>


      here is the jboss-service.xml for my service mbean:



      <depends>jboss.jca:service=HibernateFactory,name=HibernateFactory</depends>
       </mbean>
      </server>


      I expect that when the server starts that the hibernate mbean will do loaded first, then my mbean (which uses JNDI to look up the HibernateFactory) will be started. What is happening is that my mbean is being loaded first and it promptly fails trying to locate the hibernate factory. Afterwords, the Hibernate service gets started.

      If I remove my service.sar file, the server starts up normally, at which point I can drop service.sar into the deploy directory and it works fine.

      Anyone see the problem?

      Thanks in advance for any light that can be shed for me on this!

        • 1. Re: depends question using hibernate service
          dheinecke

          grrr. messed up my application jboss-service.xml... here it is:

          <server>
           <mbean code="com.symantec.esm.manager.jmx.EsmManagerService" name="ESM Manager:service=com.symantec.esm.manager.jmx.EsmManagerService,name=EsmManagerService">
           <depends>jboss.jca:service=HibernateFactory,name=HibernateFactory</depends>
           </mbean>
          </server>