日期:2014-05-18  浏览次数:20850 次

Spring+jBPM的问题:一定要hiberante.cfg.xml文件吗?
Sping   2   jbpm   3.1

参考:http://www.newsmth.net/pc/pccon.php?id=10001029&nid=269844

在applicationContext.xml中配置

<bean   id= "sessionFactory "
class= "org.springframework.orm.hibernate3.LocalSessionFactoryBean ">
<property   name= "dataSource "   ref= "dataSource "   />
<property   name= "mappingJarLocations ">
<list>
<value> WEB-INF/lib/jbpm-3.1.2.jar </value>
</list>
</property>
<property   name= "mappingResources ">
<list>
<value> hibernate-mapping.hbm.xml </value>
</list>
</property>
<property   name= "hibernateProperties ">
<props>
<prop   key= "hibernate.dialect ">
${hibernate.dialect}
</prop>
<!--  
<prop   key= "hibernate.query.factory_class ">
org.hibernate.hql.classic.ClassicQueryTranslatorFactory
</prop>
-->
<prop   key= "hibernate.show_sql "> true </prop>
<prop   key= "hibernate.generate_statistics "> true </prop>
<prop   key= "hibernate.hbm2ddl.auto "> update </prop>
</props>
</property>
<property   name= "eventListeners ">
<map>
<entry   key= "merge ">
<bean
class= "org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener "   />
</entry>
</map>
</property>
</bean>

<!--   reading   jBPM   process   definitions   -->
<bean   id= "appWorkflow "
class= "org.springmodules.workflow.jbpm31.definition.ProcessDefinitionFactoryBean ">
<property   name= "definitionLocation "
value= "/WEB-INF/processdefinition.xml "   />
</bean>


<!--   jBPM   configuration-->
<bean   id= "jbpmConfiguration "
class= "org.springmodules.workflow.jbpm31.LocalJbpmConfigurationFactoryBean ">
<property   name= "sessionFactory "   ref= "sessionFactory "   />
<property   name= "configuration "   value= "/WEB-INF/jbpm.cfg.xml "   />
<property   name= "processDefinitions ">
<list>
<ref   local= "appWorkflow "   />
</list>
</property>
<property   name= "createSchema "   value= "true "   />
</bean>

<!--   jBPM   template   -->
<bean   id= "jbpmTemplate "
class= "org.springmodules.workflow.jbpm31.JbpmTemplate ">
<constructor-arg   index= "0 "   ref= "jbpmConfiguration "   />
<constructor-arg   index= "1 "   ref= "appWorkflow "   />
</bean>


出错:没有配置String类型变量 "default.jbpm.context "

按文章提到的解决方法:
——————
原文:
针对jbpm3.1.2,在按照如上所示配置完成后,启动过程log里会抱错,