[jboss-user] [jBPM] - JBPM 4.4 and Spring 3
Donald Walters
do-not-reply at jboss.com
Thu Sep 9 11:19:28 EDT 2010
Donald Walters [http://community.jboss.org/people/dondragon2] created the discussion
"JBPM 4.4 and Spring 3"
To view the discussion, visit: http://community.jboss.org/message/560650#560650
--------------------------------------------------------------
For days now I am struggling with this issue of integrating Spring 3 and JBPM 4.
Apparently the application fails each time when I try to perform an action on one of the services, such as the repository service or the execution service.
By doing form search I found out that there is a documented issue JBPM-2710.
I have tried the solution as documented below.
http://diversit.eu/2010/01/10/jbpm-4-3-with-spring/comment-page-1/#comment-403 http://diversit.eu/2010/01/10/jbpm-4-3-with-spring
still the problem persists. I tried to step through the code and I found that the issue is in the SpringTransactionIntercepter. Apparently no matter what I set in the jbpm.cfg.xml the transactionName is always null.
JBPM CFG
===========
<jbpm-configuration>
<import resource="jbpm.default.cfg.xml" />
<import resource="jbpm.tx.spring.cfg.xml" />
<import resource="jbpm.jpdl.cfg.xml" />
<import resource="jbpm.bpmn.cfg.xml" />
<import resource="jbpm.identity.cfg.xml" />
<import resource="jbpm.businesscalendar.cfg.xml" />
<import resource="jbpm.console.cfg.xml" />
<import resource="jbpm.jobexecutor.cfg.xml" />
<process-engine-context>
<!-- Default command service has a Spring transaction interceptor-->
<command-service name="newTxRequiredCommandService">
<retry-interceptor />
<environment-interceptor policy="requiresNew" />
<spring-transaction-interceptor
policy="requiresNew" transaction-manager="hibernateTransactionManager" />
</command-service>
<command-service name="txRequiredCommandService">
<retry-interceptor />
<environment-interceptor />
<spring-transaction-interceptor transaction-manager="hibernateTransactionManager" />
</command-service>
</process-engine-context>
<transaction-context>
<transaction type="spring" />
<hibernate-session current="true" />
</transaction-context>
<!-- <process-engine-context>
<string name="spring.cfg" value="workflow.cfg.xml" />
</process-engine-context>-->
</jbpm-configuration>
<jbpm-configuration>
<import resource="jbpm.default.cfg.xml" />
<import resource="jbpm.tx.spring.cfg.xml" />
<import resource="jbpm.jpdl.cfg.xml" />
<import resource="jbpm.bpmn.cfg.xml" />
<import resource="jbpm.identity.cfg.xml" />
<import resource="jbpm.businesscalendar.cfg.xml" />
<import resource="jbpm.console.cfg.xml" />
<import resource="jbpm.jobexecutor.cfg.xml" />
<process-engine-context>
<!-- Default command service has a Spring transaction interceptor-->
<command-service name="newTxRequiredCommandService">
<retry-interceptor />
<environment-interceptor policy="requiresNew" />
<spring-transaction-interceptor
policy="requiresNew" transaction-manager="hibernateTransactionManager" />
</command-service>
<command-service name="txRequiredCommandService">
<retry-interceptor />
<environment-interceptor />
<spring-transaction-interceptor transaction-manager="hibernateTransactionManager" />
</command-service>
</process-engine-context>
<transaction-context>
<transaction type="spring" />
<hibernate-session current="true" />
</transaction-context>
</jbpm-configuration>
Spring Config
=================
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
xmlns:context=" http://www.springframework.org/schema/context http://www.springframework.org/schema/context"
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:annotation-config />
<context:component-scan base-package="com.cavet.core.jbpm"/>
<bean id="jbpmSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="mappingResources">
<list>
<value>jbpm.repository.hbm.xml</value>
<value>jbpm.execution.hbm.xml</value>
<value>jbpm.history.hbm.xml</value>
<value>jbpm.task.hbm.xml</value>
<value>jbpm.identity.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
</props>
</property>
</bean>
<bean id="hibernateTransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="jbpmSessionFactory" />
<property name="dataSource" ref="dataSource" />
</bean>
</beans>
Class
=============
...
@Autowired
@Qualifier("jbpmExecutionService")
private ExecutionService executionService;
...
executionService.startProcessInstanceByKey(name, variables); <----nothing happens here and in the spring intercepter
Please help me in trying to resolve this. Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/560650#560650]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100909/955ca78a/attachment-0001.html
More information about the jboss-user
mailing list