[jboss-user] [jBPM Users] - Re: Problem moving from 4.1 to 4.2 using Spring configuratio

saraswati.santanu do-not-reply at jboss.com
Fri Nov 13 01:00:18 EST 2009

Did you provide the hbm files to spring bean?

jbpm.hibernate.cfg.xml might be there, but you have not mentioned it in your jbpm.cfg.xml file. So jbpm will not get it. Now if you mention something like this in your jbpm.cfg.xml file 

  |     <hibernate-configuration>
  |       <cfg resource="jbpm.hibernate.cfg.xml" />     
  |     </hibernate-configuration>

the it might create some more problem. 

When you are using jbpm with spring then you should let spring create the session factory and jbpm use that.

So just to have the jbpm.hibernate.cfg.xml will not help, and more over if you try to use that by giving it directly to jbpm cfg then you might end up in two session factories, one by spring and one by jbpm. That will be extremely messy.

The correct thing to do here is to provide the jbpm hbm files to spring local sessionfactory bean. The spring bean should have these entries, assuming the hbm files are in classpath:

  | 	<property name="mappingLocations">
  | 		<list>
  |                     <value>classpath:jbpm.execution.hbm.xml</value>
  |                     <value>classpath:jbpm.repository.hbm.xml</value>
  |                     <value>classpath:jbpm.task.hbm.xml</value>
  |                     <value>classpath:jbpm.history.hbm.xml</value>
  | 		</list>
  | 	</property>

Hope this will see you through to success :)

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

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

More information about the jboss-user mailing list