Red Hat Bugzilla – Bug 964987
BPEL Catch faultMessageType attribute should be optional
Last modified: 2015-08-02 19:43:58 EDT
Description of problem:
catch element specification says:
( faultMessageType="QName" | faultElement="QName" )? >*
As you can see, faultMessageType should be optional but If I don't set it, BPEL engine throws following exception in deployment time:
loan_approval.bpel:28: error: [VariableDeclMissingType] Declaration of variable "error" does not specify the required type (either MessageType or ElementType).
When I set the faultMessageType, the process is deployed and everything works well.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Created attachment 750495 [details]
loan approval - this archive contains the loan_approval.bpel
It appears that if the faultName attribute is added back on the catch element, that it will compile. For example,
<catch faultName="ans:loanProcessFault" faultVariable="error"
So it looks like there is an underlying bug, as it should be possible to just specify the variable and element type, but this may provide a workaround in the interim.
Ivo, could you confirm whether this workaround works for you?
Created attachment 750570 [details]
Example showing the workaround with fault name set.
As Gary pointed, the issue was caused by missing xmlns:ens="http://example.com/loan-approval/xsd/error-messages/" namespace. The second change to make it work is to remove attribute "part" in the copy element because the non-message variable "error" doesn't have any parts.