Bug 779620 (SOA-1990) - cannot mark externally managed transaction for rollback error message
Summary: cannot mark externally managed transaction for rollback error message
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-1990
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: Documentation
Version: 5.0.0 GA
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 5.1.0 GA
Assignee: David Le Sage
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-03-15 15:34 UTC by Burr Sutter
Modified: 2011-03-07 00:52 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-07 00:52:05 UTC
Type: Bug


Attachments (Terms of Use)
log.zip (89.35 KB, application/zip)
2010-03-15 15:37 UTC, Burr Sutter
no flags Details
dvdstore-orders-queue-service.xml (401 bytes, text/xml)
2010-03-15 15:38 UTC, Burr Sutter
no flags Details
jboss-seam-dvdstore-ds.xml (1.37 KB, text/xml)
2010-03-15 15:38 UTC, Burr Sutter
no flags Details
jboss-seam-dvdstore.ear (4.24 MB, application/octet-stream)
2010-03-15 15:38 UTC, Burr Sutter
no flags Details
DVD_Pet_StoreDemo_5.0.0.esb.zip (25.33 KB, application/zip)
2010-03-15 15:41 UTC, Burr Sutter
no flags Details
Demo_deploy.png (173.31 KB, image/png)
2010-03-15 15:42 UTC, Burr Sutter
no flags Details
DVD_Pet_StoreDemo_5.0.0.zip (68.03 KB, application/zip)
2010-03-15 15:43 UTC, Burr Sutter
no flags Details
DVD_Pet_StoreDemo_5.0.0_broken3.zip (619.25 KB, application/zip)
2010-03-17 02:44 UTC, Burr Sutter
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SOA-1990 0 Major Closed cannot mark externally managed transaction for rollback error message 2014-05-15 15:33:20 UTC

Description Burr Sutter 2010-03-15 15:34:59 UTC
Date of First Response: 2010-03-18 05:33:42
project_key: SOA

http://localhost:8080/seam-dvdstore/
shop for a DVD, process all the way through checkout
application is nearly identical to the one shown here:
http://www.redhat.com/v/webcast/SOAdemo2/SOADemo2.html

DVDStore comes from the Seam directory but is modified with an interceptor to "wiretap" the shopping cart and route orders to a JMS queue which is picked up by the ESB.


Error message is:
11:30:22,832 ERROR [JmsServerSession] Unexpected error delivering message delegator->JBossMessage[5196460123226116]:PERSISTENT, deliveryId=0
org.jbpm.JbpmException: cannot mark externally managed transaction for rollback
	at org.jbpm.persistence.db.DbPersistenceService.endTransaction(DbPersistenceService.java:129)
	at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:201)
	at org.jbpm.svc.Services.close(Services.java:247)
	at org.jbpm.JbpmContext.close(JbpmContext.java:131)
	at org.jbpm.command.impl.CommandServiceImpl.execute(CommandServiceImpl.java:79)
	at org.jboss.soa.esb.services.jbpm.cmd.CommandExecutor.executeJbpmCommand(CommandExecutor.java:279)
	at org.jboss.soa.esb.services.jbpm.cmd.CommandExecutor.access$100(CommandExecutor.java:51)
	at org.jboss.soa.esb.services.jbpm.cmd.CommandExecutor$3.execute(CommandExecutor.java:136)
	at org.jboss.soa.esb.services.jbpm.actions.JBpmCallback.process(JBpmCallback.java:68)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.processMethods(ActionProcessorMethodInfo.java:102)
	at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor.process(OverriddenActionLifecycleProcessor.java:74)
	at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:634)
	at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:588)
	at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:419)
	at org.jboss.soa.esb.listeners.jca.JcaMessageAwareListener.process(JcaMessageAwareListener.java:163)
	at org.jboss.soa.esb.listeners.jca.JcaJMSInflowMessageProcessorAdapter.onMessage(JcaJMSInflowMessageProcessorAdapter.java:44)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.jboss.soa.esb.listeners.jca.BaseJcaInflow$1.invoke(BaseJcaInflow.java:205)
	at org.jboss.soa.esb.listeners.jca.EndpointProxy.delivery(EndpointProxy.java:258)
	at org.jboss.soa.esb.listeners.jca.EndpointProxy.invoke(EndpointProxy.java:150)
	at $Proxy225.onMessage(Unknown Source)
	at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:179)
	at org.jboss.jms.client.container.ClientConsumer.callOnMessageStatic(ClientConsumer.java:160)
	at org.jboss.jms.client.container.SessionAspect.handleRun(SessionAspect.java:831)
	at org.jboss.aop.advice.org.jboss.jms.client.container.SessionAspect_z_handleRun_16177011.invoke(SessionAspect_z_handleRun_16177011.java)
	at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
	at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)
	at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86)
	at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
	at org.jboss.jms.client.delegate.ClientSessionDelegate.run(ClientSessionDelegate.java)
	at org.jboss.jms.client.JBossSession.run(JBossSession.java:199)
	at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:236)
	at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)
	at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Comment 1 Burr Sutter 2010-03-15 15:37:04 UTC
boot.log and server.log after clean installation, installation of the demo app and execution to show the error messages

Comment 2 Burr Sutter 2010-03-15 15:37:04 UTC
Attachment: Added: log.zip


Comment 3 Burr Sutter 2010-03-15 15:38:46 UTC
DVD Store binary - drop 3 files into your deploy directory

Comment 4 Burr Sutter 2010-03-15 15:38:46 UTC
Attachment: Added: dvdstore-orders-queue-service.xml
Attachment: Added: jboss-seam-dvdstore-ds.xml
Attachment: Added: jboss-seam-dvdstore.ear


Comment 5 Burr Sutter 2010-03-15 15:41:39 UTC
JBoss ESB application 

The attached zip should be unzipped and dropped into deploy directory

Comment 6 Burr Sutter 2010-03-15 15:41:39 UTC
Attachment: Added: DVD_Pet_StoreDemo_5.0.0.esb.zip


Comment 7 Burr Sutter 2010-03-15 15:42:04 UTC
Attached an image of the deploy directory

Comment 8 Burr Sutter 2010-03-15 15:42:04 UTC
Attachment: Added: Demo_deploy.png


Comment 9 Burr Sutter 2010-03-15 15:43:41 UTC
JBDS3 Project attached as DVD_Pet_StoreDemo_5.0.0.zip

Comment 10 Burr Sutter 2010-03-15 15:43:41 UTC
Attachment: Added: DVD_Pet_StoreDemo_5.0.0.zip


Comment 11 Burr Sutter 2010-03-17 02:44:49 UTC
Attach is a zipped JBDS 3.0 CR2 Project. unzip and then use File-Import

The way to operate the demo is to place a copy of file_sample_order.xml into /tmp/inboundOrders for the File_Stater_Service - it will transform and route to Starter_Service which is normally how DVDStore starts this up.

and don't forget to first deploy the jBPM Process (similar to bpm_orchestration4) via JBDS Graphical Process Designer


ERROR [JmsServerSession] Unexpected error delivering message delegator->JBossMessage[5196979216547898]:PERSISTENT, deliveryId=8
org.jbpm.JbpmException: cannot mark externally managed transaction for rollback
	at org.jbpm.persistence.db.DbPersistenceService.endTransaction(DbPersistenceService.java:129)
	at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:201)
	at org.jbpm.svc.Services.close(Services.java:247)
	at org.jbpm.JbpmContext.close(JbpmContext.java:131)
	at org.jbpm.command.impl.CommandServiceImpl.execute(CommandServiceImpl.java:79)
	at org.jboss.soa.esb.services.jbpm.cmd.CommandExecutor.executeJbpmCommand(CommandExecutor.java:279)
	at org.jboss.soa.esb.services.jbpm.cmd.CommandExecutor.access$100(CommandExecutor.java:51)
	at org.jboss.soa.esb.services.jbpm.cmd.CommandExecutor$3.execute(CommandExecutor.java:136)
	at org.jboss.soa.esb.services.jbpm.actions.JBpmCallback.process(JBpmCallback.java:68)

Comment 12 Burr Sutter 2010-03-17 02:44:49 UTC
Attachment: Added: DVD_Pet_StoreDemo_5.0.0_broken3.zip


Comment 13 Kevin Conner 2010-03-18 09:33:42 UTC
The exception is a bug in the jBPM class but it occurs because the encompassing transaction has been marked for rollback.  There are, therefore, two issues

- fix the bug in the jBPM codebase
- find out why the transaction has been marked for roll back.

My guess for the second is that there has been a hibernate 'stale state' issue and that the jBPM codebase should just be rolling back the transaction and allowing the JCA inflow to redeliver.


Comment 14 Kevin Conner 2010-03-18 09:38:36 UTC
Also, it appears from the exception that this is being reported by the JCA inflow.  If that is the case then the message should have been redelivered, do we know if this happens?


Comment 15 Kevin Conner 2010-03-18 09:44:14 UTC
The logs would suggest it is being retried, eventually ending up in the DLQ.  If this was just a 'stale state' exception then I would expect one of the retries to have succeeded.

As there are multiple jBPM classes then another possibility could be that something has 'leaked' out of the DVD store into the external process, probably a class loaded with a separate classloader.

Comment 16 Tom Fennelly 2010-03-18 16:17:43 UTC
The issue (as I'm seeing it in a debugger) is that the JbpmCallBack service is trying to deserialize an OrderHeader object instance from the ESB message (as part of a process of mapping objects from the message and into jBPM for process execution I think) and is choking because it doesn't have access to the OrderHeader type (CNF Exception). 

Comment 17 Anne-Louise Tangring 2010-09-21 20:35:14 UTC
Is this already captured in documentation? If not, check back with Kevin and he will help write something up.
Candidate for SOA 5.1.0

Comment 18 Anne-Louise Tangring 2010-12-02 16:35:27 UTC
This is a nice to have for SOA 5.1.0. Kevin to provide docs input.

Comment 20 Kevin Conner 2011-01-05 10:37:50 UTC
This is a docs issue, I will provide some input.

Comment 21 Kevin Conner 2011-03-06 18:31:49 UTC
Link: Added: This issue depends JBESB-3579


Comment 22 Kevin Conner 2011-03-06 18:32:50 UTC
Added a warning to the section within Services Guide

Comment 23 Dana Mison 2011-03-07 00:25:15 UTC
David can you get these changes merged in and staged today please 

Comment 24 David Le Sage 2011-03-07 00:52:05 UTC
Release Notes Docs Status: Added: Not Required
Release Notes Text: Added: Merged into downstream product document.


Comment 25 David Le Sage 2011-03-07 00:52:25 UTC
Writer: Added: dlesage



Note You need to log in before you can comment on or make changes to this bug.