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

    depends question using hibernate service

    David Heinecke Newbie

      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:

       <mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateFactory,name=HibernateFactory">
       <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">
       <attribute name="ShowSql">false</attribute>
       <attribute name="TransactionStrategy">net.sf.hibernate.transaction.JDBCTransactionFactory</attribute>
       <attribute name="UserTransactionName">UserTransaction</attribute>

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


      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!