[jboss-user] [JBoss jBPM] - Re: Jbpm classes deployed inside a hibernate HAR

jurglic do-not-reply at jboss.com
Wed Aug 16 19:04:49 EDT 2006


Actually, you don't need har. Any sar will do. 

Basically, you need a sar with all the hbm.xml files of jbpm and following mbean:

  |     <mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.jca:service=HibernateFactory,name=HibernateFactory">
  | 
  |         <depends>jboss.jca:service=RARDeployer</depends>
  |         <depends>jboss.jca:service=DataSourceBinding,name=HibernateDB2</depends>
  | 
  |         <attribute name="SessionFactoryName">java:/HibernateSessionFactory</attribute>
  |         <attribute name="DatasourceName">java:/HibernateDB2</attribute>
  |         <attribute name="Dialect">org.hibernate.dialect.DB2Dialect</attribute>
  | 
  |         <attribute name="ShowSqlEnabled">true</attribute>
  |         <attribute name="ScanForMappingsEnabled">true</attribute>
  | 
  |     </mbean>
  | 

The mbean above will initialize hibernate session factory and load all hbm.xml files in the enclosing sar. Those mapping files should be for jbpm persistent objects and for yours own as well.

That was first step. Second step is to configure jbpm to use configured hibernate session factory and to deploy it. You can do that with customizing jbpm.cfg.xml in your jbpm sar. More accurately, you must configure persistence service in the following manner:
    <service name="persistence">
  |       <factory>
  |         <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
  |           <field name="sessionFactoryJndiName">
  |             <string value="java:/HibernateSessionFactory" />
  |           </field>
  |         </bean>
  |       </factory>
  |     </service>

And thats about it.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965593#3965593

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965593



More information about the jboss-user mailing list