cancel
Showing results for 
Search instead for 
Did you mean: 

Transaction RollbackException with Activiti/WebSphere/Spring

bwestrich
Champ in-the-making
Champ in-the-making
Hello Activiti gurus,

I'm attempting to embed Activiti (5.8) into a WebSphere (7.x) application using Spring (3.0.4), but am getting a javax.transaction.RollbackException.

Here's my Spring config:

<tx:annotation-driven />
<tx:jta-transaction-manager />
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="resourceRef" value="true" />
<property name="jndiName" value="jdbc/myDsName" />
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="true" />
<property name="jobExecutorActivate" value="false" />
</bean>
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>

The error happens inside a message driven EJB when RuntimeServiceImpl.startProcessInstanceByKey is called. Here’s the stack trace:

org.springframework.transaction.TransactionSystemException: UOWManager transaction processing failed; nested exception is com.ibm.wsspi.uow.UOWException: javax.transaction.RollbackException
       at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:288)
       at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:124)
       at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
       at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
       at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:41)
       at org.mypackage.Activiti.startProcessInstance(Activiti.java:390)
       at org.mypackage.ActivitiPayments.processEvent(ActivitiPayments.java:18)
       at org.mypackage.BpsmListenerServiceMessageHandler.doHandleMessage(BpsmListenerServiceMessageHandler.java:103)
       at org.mypackage.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:52)
       at org.mypackage.BpsmListenerService.onMessage(BpsmListenerService.java:41)

Any ideas how to resolve this?

Brian

Brian Westrich
bw@mcwest.com
3 REPLIES 3

bwestrich
Champ in-the-making
Champ in-the-making
I also noticed this on the SystemOut.log…….. 

[11/2/11 12:22:40:974 CDT] 00000026 SystemOut     O [12:22:40,974 INFO  'WMQJCAResourceAdapter : 0' org.mypackage.ArrivedListener ArrivedListener] arrived fired for process instance 3505
[11/2/11 12:22:41:209 CDT] 00000026 RegisteredRes E   WTRN0063E: An illegal attempt to commit a one phase capable resource with existing two phase capable resources has occurred.[11/2/11 12:22:41:224 CDT] 00000026 RegisteredRes E   WTRN0086I: XAException encountered during prepare phase for transaction BPSMEA#bpsm-service-ejb-1.39-SNAPSHOT.jar#BpsmListenerService 00000133654DDA03000000010000001737CC227B4A7BDDB5D2D3D44C9362B668BF7B37E700000133654DDA03000000010000001737CC227B4A7BDDB5D2D3D44C9362B668BF7B37E700000001. Local resources follow.
[11/2/11 12:22:41:224 CDT] 00000026 JTAResourceBa I   WTRN0089I: LocalTransactionWrapper@:16d716d7  localTransaction:com.ibm.ws.rsadapter.spi.WSRdbSpiLocalTransactionImpl@53c853c8  enlisted:trueHas Tran Rolled Back = false  registeredForSynctruemcWrapper.hashcode()371267105: Vote: none.
[11/2/11 12:22:41:224 CDT] 00000026 JTAResourceBa I   WTRN0089I: XATransactionWrapper@ 6730673  XAResource: com.ibm.ejs.jms.JMSManagedSession$JMSXAResource@6ec46ec4  enlisted: trueHas Tran Rolled Back = false  mcWrapper.hashCode()1802660722: Vote: commit.

trademak
Star Contributor
Star Contributor
Is the database you configured a XA resource?
And are you using a XA transaction manager because you need two phase commit?

Best regards,

bwestrich
Champ in-the-making
Champ in-the-making
Yes, the datasource I initially used was an XA resource.  We don't need two phase commit, so I just changed the datasource to a non XA resource, and this resolved the issue. Many thanks!