Bug 820031

Summary: Exception handling after SyncServiceInvoker fails
Product: [JBoss] JBoss Enterprise SOA Platform 5 Reporter: Jason Shepherd <jshepherd>
Component: JBossESBAssignee: Jason Shepherd <jshepherd>
Status: CLOSED CURRENTRELEASE QA Contact: Robert Balent <rbalent>
Severity: unspecified Docs Contact:
Priority: high    
Version: 5.3.0 GACC: atangrin, dlesage, jcoleman, jpechane, ldimaggi, mvecera, rwagner, sdorfiel, soa-p-jira, tasato
Target Milestone: ER1   
Target Release: 5.3.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Exception handling issues can arise after the SyncServiceInvoker fails. If an exception is thrown after the SyncServiceInvoker call, the error is not sent to the client. This can be resolved by setting a "FaultTo" EPR in a custom composer-class set on the service's FS-Provider.
Story Points: ---
Clone Of:
: 852809 881857 (view as bug list) Environment:
Last Closed: 2012-11-29 17:17:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 852809, 881857, 848807    
Attachments:
Description Flags
User's example.
none
Suggested fix for Branch JBESB_4_11_CP none

Description Jason Shepherd 2012-05-09 00:12:09 UTC
Description of problem:

I have an EBWS based service which is using the SyncServiceInvoker to call a second service. This all works fine but if I throw an exception after the SyncServiceInvoker call the exception is not propagated to the client as a soap fault.
However if I remove the invocation of the SyncServiceInvoker and throw an exception, a soap fault is sent to the client.
I have attached a test project which demonstrates this.

To see the fault just comment out the SyncServiceInvoker call.


Version-Release number of selected component (if applicable):
4.10

How reproducible:
Use attached example project

Steps to Reproduce:
1. Deploy the attached example project to SOA Platform 5.2.0
2. Use any SOAP Client to send a WS request to the ESB.
3. Observe that the returned response is not a SOAP Fault

Comment 1 Rick Wagner 2012-05-11 13:22:34 UTC
Created attachment 583845 [details]
User's example.

Comment 2 Rick Wagner 2012-05-11 15:37:51 UTC
The attached reproducer shows that the caller might or might not see a fault depending on whether or not ServiceInvoker is used in the Action chain.

On the Support case, Jason has suggested this might be related to https://issues.jboss.org/browse/JBESB-3772.

Could we please take a look at this for SOA-P 5.3?

Comment 3 Jason Shepherd 2012-05-16 00:29:58 UTC
The customer tried the suggestion on issue, JBESB-3772. And found it fixed this problem. 

We suggest the change implementer try suggestions there as a starting point.

Comment 4 Rick Wagner 2012-05-22 12:27:03 UTC
GSS bumping from 'medium' to 'high'.  The customer is expressing interest in the issue, we would really like this one for 5.3.

Thanks,

Rick

Comment 5 Rick Wagner 2012-06-06 13:03:50 UTC
Not accepted as a blocker for 5.3, but we probably should re-visit this issue later.

Comment 6 Suz 2012-06-12 05:00:36 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Exception handling issues can arise after the SyncServiceInvoker fails. If an exception is thrown after the SyncServiceInvoker call, the error is not sent to the client. This can be resolved by setting a "FaultTo" EPR in a custom composer-class set on the service's FS-Provider.

Comment 7 Jason Shepherd 2012-08-12 22:50:35 UTC
I confirmed this issue still exists on the 5.3 branch. Could we please have this addressed in the next roll-up patch?

Comment 8 JBoss JIRA Server 2012-08-28 21:57:14 UTC
Jason Shepherd <jshepherd> made a comment on jira JBESB-3796

Suggested fix to be implemented on 4.11_CP branch

Comment 9 Jason Shepherd 2012-08-28 21:59:26 UTC
Created attachment 607702 [details]
Suggested fix for Branch JBESB_4_11_CP

Pending QA Approval

Comment 10 JBoss JIRA Server 2012-09-21 10:57:45 UTC
Sato Tadayoshi <tadayosi> made a comment on jira JBESB-3796

I find that rather the root cause should be located in ActionProcessingPipeline. I understand that the core philosophy of ActionProcessingPipeline is use the ReplyTo/FaultTo of the original request message header when it returns the normal response message or the fault message regardless of however these headers are changed during the action processing. At the innermost processPipeline(Message) method, the call info of the original request message is surely cached to 'callDetails' variable, and this cache is consistently refered to for determining the FaultTo EPR in the faultTo method when an exception occurs while processing actions. However, what's not consistent is when the error message is created by invoking Factory.createErrorMessage(...) method, which unfortunatelly refers to the original request message itself instead of the callDetails cache. To make things worse, Factory.createErrorMessage(...) returns the input message rather than a newly created error message if the input message doesn't have ReplyTo/FaultTo in its header, which is the case of this issue. That's why an ESB service doesn't return a SOAP fault but the normal result of SyncServiceInvoker to the client.

Considering that the problem is in this inconsistency of ActionProcessingPipeline and the same issue can occur with any actions which manipulates the request message header to null, I think the correct fix to the issue should be modifying ActionProcessingPipeline and Factory.createErrorMessage(...).

Comment 11 JBoss JIRA Server 2012-10-12 09:04:31 UTC
Tadayoshi Sato <tadayosi> updated the status of jira JBESB-3796 to Resolved