2 Replies Latest reply on Jun 3, 2004 12:07 PM by noel.rocher

    Nukes and Hibernate

    sysuser1

      I would to deploy a module in Nukes and use Hibernate to manage persistence...
      There is my xml file (jboss-service) of my module :

      <server>
       <mbean
       code="org.jboss.nukes.addons.modules.essaiHibernate.Module"
       name="nukes.modules:name=moduleHibernate"
       xmbean-dd=""
       xmbean-code="org.jboss.nukes.component.NukesMBean">
       <depends>nukes.modules:name=core</depends>
       <xmbean>
       <attribute name="Configuration">
       <module>
       <operation name="main" display-name="ModuleHibernate" description="Premier module hibernate" image="" hint=""/>
       </module>
       </attribute>
       </xmbean>
       </mbean>
      </server>
      

      However, in the Hibernate site (http://www.hibernate.org) they say that jboss-service.xml must be like this to integrate Hibernate in JBoss :
      <server>
      <mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateFactory, name=HibernateFactory">
       <depends>jboss.jca:service=RARDeployer</depends>
       <depends>jboss.jca:service=LocalTxCM,name=NukesDS</depends>
       <!-- Make it deploy ONLY after DataSource had been started -->
       <attribute name="MapResources">mappings/Style.hbm.xml</attribute>
       <attribute name="JndiName">java:/hibernate/HibernateFactory</attribute>
       <attribute name="Datasource">java:/NukesDS</attribute>
       <attribute name="Dialect">net.sf.hibernate.dialect.MySQLDialect</attribute>
       <attribute name="TransactionStrategy">net.sf.hibernate.transaction.JTATransactionFactory</attribute>
       <attribute name="TransactionManagerLookupStrategy">net.sf.hibernate.transaction.JBossTransactionManagerLookup</attribute>
       <attribute name="UseOuterJoin">false</attribute>
       <attribute name="ShowSql">true</attribute>
       <attribute name="UserTransactionName">UserTransaction</attribute>
      </mbean>
      </server>
      

      What I have to do to deploy my module using Hibernate?

        • 1. Re: Nukes and Hibernate
          jae77

          you need to have two seperate mbean definitions for this (both in the jboss-service.xml descriptor). one to control the hibernate service, and the other to control the module that you are writing.

          • 2. Re: Nukes and Hibernate
            noel.rocher

            One is used to "mount" hibernate services (the second example in your message).

            The other is used to "mount" your Nuke Module 's services.