You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Charles Moulliard (JIRA)" <ji...@apache.org> on 2009/08/31 17:06:41 UTC

[jira] Created: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

onException does not work correctly when used in a transacted route and exception is not send to the bean component called
--------------------------------------------------------------------------------------------------------------------------

                 Key: CAMEL-1965
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
             Project: Apache Camel
          Issue Type: Bug
            Reporter: Charles Moulliard


Hi,

When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!

{code}
Route
		<camel:route errorHandlerRef="txErrorHandlerReqNew">
			<camel:from ref="fileClientEndpoint" />
			<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
			
		    <camel:onException>
	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
				<camel:bean ref="serviceHelper" method="processException" />
				<camel:to ref="queueReportingEndpoint" />
            </camel:onException>
			
			<camel:onException>
				<camel:exception>java.lang.Exception</camel:exception>
				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
				<camel:rollback/>
		    </camel:onException>
{code}

{code}
Log

16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
, BodyType:org.apache.camel.component.file.GenericFile
, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
]
16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)

{code}

REMARK : 
- Exception object is not received by the bean component

but everything works fine if the route is defined like this 

{code}
		<camel:route>
			<camel:from ref="fileClientEndpoint" />

		    <camel:onException>
	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
				<camel:bean ref="serviceHelper" method="processException" />
				<camel:to ref="queueReportingEndpoint" />
            </camel:onException>
			
			<camel:onException>
				<camel:exception>java.lang.Exception</camel:exception>
				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
		    </camel:onException>
{code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54010#action_54010 ] 

Claus Ibsen commented on CAMEL-1965:
------------------------------------

Try with something else that a file to start with as Windows is a bit clunky with file IO.

And does it fail *every* time with transacted + file?

Try adding a <delay><constant>3000</constant></delay> before the rollback to give Windows a bit time before the rollback is performed.

> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Charles Moulliard
>         Attachments: BookService.java, springTransactionalClientDataSourceUsingTransactedOnException.xml, SpringTransactionalClientDataSourceUsingTransactedOnExceptionTest.java, transactionalClientDataSource.xml
>
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> <camel:route errorHandlerRef="txErrorHandlerReqNew">
> 	<camel:from ref="fileClientEndpoint" />
> 	<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 		
>          <camel:onException>
> 	       	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 		<camel:bean ref="serviceHelper" method="processException" />
> 		<camel:to ref="queueReportingEndpoint" />
>            </camel:onException>
> 	
> 	<camel:onException>
> 		<camel:exception>java.lang.Exception</camel:exception>
> 		<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		<camel:rollback/>
>     </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID, ...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Charles Moulliard (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Charles Moulliard updated CAMEL-1965:
-------------------------------------

    Attachment: transactionalClientDataSource.xml

> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Charles Moulliard
>         Attachments: BookService.java, springTransactionalClientDataSourceUsingTransactedOnException.xml, SpringTransactionalClientDataSourceUsingTransactedOnExceptionTest.java, transactionalClientDataSource.xml
>
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> <camel:route errorHandlerRef="txErrorHandlerReqNew">
> 	<camel:from ref="fileClientEndpoint" />
> 	<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 		
>          <camel:onException>
> 	       	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 		<camel:bean ref="serviceHelper" method="processException" />
> 		<camel:to ref="queueReportingEndpoint" />
>            </camel:onException>
> 	
> 	<camel:onException>
> 		<camel:exception>java.lang.Exception</camel:exception>
> 		<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		<camel:rollback/>
>     </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID, ...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-1965:
-------------------------------

    Attachment:     (was: camel_1965.patch)

> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Charles Moulliard
>         Attachments: BookService.java, file_patch.patch, springTransactionalClientDataSourceUsingTransactedOnException.xml, SpringTransactionalClientDataSourceUsingTransactedOnExceptionTest.java, transactionalClientDataSource.xml
>
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> <camel:route errorHandlerRef="txErrorHandlerReqNew">
> 	<camel:from ref="fileClientEndpoint" />
> 	<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 		
>          <camel:onException>
> 	       	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 		<camel:bean ref="serviceHelper" method="processException" />
> 		<camel:to ref="queueReportingEndpoint" />
>            </camel:onException>
> 	
> 	<camel:onException>
> 		<camel:exception>java.lang.Exception</camel:exception>
> 		<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		<camel:rollback/>
>     </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID, ...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53919#action_53919 ] 

Claus Ibsen commented on CAMEL-1965:
------------------------------------

Please format your reports so they are readable. When you post logs that are 2000 lines long its annoying and hard to read.

And report Camel version number
And post your endpoint uris so we can see them
And as well with your error handling configuration.
And post your full route.

All these are important details.



> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>            Reporter: Charles Moulliard
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> 		<camel:route errorHandlerRef="txErrorHandlerReqNew">
> 			<camel:from ref="fileClientEndpoint" />
> 			<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 			
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 				<camel:rollback/>
> 		    </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> ]
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54043#action_54043 ] 

Claus Ibsen commented on CAMEL-1965:
------------------------------------

Charles is this issue fixed?

Eg the onException and transacted works for you now?


> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Charles Moulliard
>         Attachments: BookService.java, file_patch.patch, springTransactionalClientDataSourceUsingTransactedOnException.xml, SpringTransactionalClientDataSourceUsingTransactedOnExceptionTest.java, transactionalClientDataSource.xml
>
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> <camel:route errorHandlerRef="txErrorHandlerReqNew">
> 	<camel:from ref="fileClientEndpoint" />
> 	<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 		
>          <camel:onException>
> 	       	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 		<camel:bean ref="serviceHelper" method="processException" />
> 		<camel:to ref="queueReportingEndpoint" />
>            </camel:onException>
> 	
> 	<camel:onException>
> 		<camel:exception>java.lang.Exception</camel:exception>
> 		<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		<camel:rollback/>
>     </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID, ...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54009#action_54009 ] 

Claus Ibsen commented on CAMEL-1965:
------------------------------------

Are you using Windows?

> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Charles Moulliard
>         Attachments: BookService.java, springTransactionalClientDataSourceUsingTransactedOnException.xml, SpringTransactionalClientDataSourceUsingTransactedOnExceptionTest.java, transactionalClientDataSource.xml
>
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> <camel:route errorHandlerRef="txErrorHandlerReqNew">
> 	<camel:from ref="fileClientEndpoint" />
> 	<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 		
>          <camel:onException>
> 	       	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 		<camel:bean ref="serviceHelper" method="processException" />
> 		<camel:to ref="queueReportingEndpoint" />
>            </camel:onException>
> 	
> 	<camel:onException>
> 		<camel:exception>java.lang.Exception</camel:exception>
> 		<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		<camel:rollback/>
>     </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID, ...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Charles Moulliard (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Charles Moulliard updated CAMEL-1965:
-------------------------------------

          Description: 
Hi,

When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!

{code}
Route
<camel:route errorHandlerRef="txErrorHandlerReqNew">
	<camel:from ref="fileClientEndpoint" />
	<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
		
         <camel:onException>
	       	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
		<camel:bean ref="serviceHelper" method="processException" />
		<camel:to ref="queueReportingEndpoint" />
           </camel:onException>
	
	<camel:onException>
		<camel:exception>java.lang.Exception</camel:exception>
		<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
		<camel:rollback/>
    </camel:onException>
{code}

{code}
Log

16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID, ...

16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,
16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
, BodyType:org.apache.camel.component.file.GenericFile
, Body:ORD_REF_ID,...
16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)

{code}

REMARK : 
- Exception object is not received by the bean component

but everything works fine if the route is defined like this 

{code}
		<camel:route>
			<camel:from ref="fileClientEndpoint" />

		    <camel:onException>
	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
				<camel:bean ref="serviceHelper" method="processException" />
				<camel:to ref="queueReportingEndpoint" />
            </camel:onException>
			
			<camel:onException>
				<camel:exception>java.lang.Exception</camel:exception>
				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
		    </camel:onException>
{code}

  was:
Hi,

When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!

{code}
Route
		<camel:route errorHandlerRef="txErrorHandlerReqNew">
			<camel:from ref="fileClientEndpoint" />
			<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
			
		    <camel:onException>
	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
				<camel:bean ref="serviceHelper" method="processException" />
				<camel:to ref="queueReportingEndpoint" />
            </camel:onException>
			
			<camel:onException>
				<camel:exception>java.lang.Exception</camel:exception>
				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
				<camel:rollback/>
		    </camel:onException>
{code}

{code}
Log

16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
, BodyType:org.apache.camel.component.file.GenericFile
, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
]
16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)

{code}

REMARK : 
- Exception object is not received by the bean component

but everything works fine if the route is defined like this 

{code}
		<camel:route>
			<camel:from ref="fileClientEndpoint" />

		    <camel:onException>
	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
				<camel:bean ref="serviceHelper" method="processException" />
				<camel:to ref="queueReportingEndpoint" />
            </camel:onException>
			
			<camel:onException>
				<camel:exception>java.lang.Exception</camel:exception>
				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
		    </camel:onException>
{code}

    Affects Version/s: 2.0.0

> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Charles Moulliard
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> <camel:route errorHandlerRef="txErrorHandlerReqNew">
> 	<camel:from ref="fileClientEndpoint" />
> 	<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 		
>          <camel:onException>
> 	       	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 		<camel:bean ref="serviceHelper" method="processException" />
> 		<camel:to ref="queueReportingEndpoint" />
>            </camel:onException>
> 	
> 	<camel:onException>
> 		<camel:exception>java.lang.Exception</camel:exception>
> 		<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		<camel:rollback/>
>     </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID, ...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Charles Moulliard (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Charles Moulliard closed CAMEL-1965.
------------------------------------

    Resolution: Fixed

Issue is solved with last fix.

> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Charles Moulliard
>         Attachments: BookService.java, file_patch.patch, springTransactionalClientDataSourceUsingTransactedOnException.xml, SpringTransactionalClientDataSourceUsingTransactedOnExceptionTest.java, transactionalClientDataSource.xml
>
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> <camel:route errorHandlerRef="txErrorHandlerReqNew">
> 	<camel:from ref="fileClientEndpoint" />
> 	<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 		
>          <camel:onException>
> 	       	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 		<camel:bean ref="serviceHelper" method="processException" />
> 		<camel:to ref="queueReportingEndpoint" />
>            </camel:onException>
> 	
> 	<camel:onException>
> 		<camel:exception>java.lang.Exception</camel:exception>
> 		<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		<camel:rollback/>
>     </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID, ...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Charles Moulliard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53935#action_53935 ] 

Charles Moulliard edited comment on CAMEL-1965 at 9/1/09 12:44 AM:
-------------------------------------------------------------------

Is there a better command than "code" to format info in the wiki ?

Camel Version used : 2.0 and now 2.1-SNAPSHOT

Endpoints definition :

{code}
queueReportingEndpoint = uriQueueReporting=queuingservice:x3s:reporting (remark : queuingservice --> corresponds to activemq service packaged as separate osgi bundle)
queueRequestEndpoint= uriQueueRequest=queuingservice:x3s:request
fileClientEndpoint = uriFileClient=file://d:/temp/data/oinp/?delay=15000&move=d:/temp/data/oinp/backup/${date:now:yyyyMMdd}/${file:name.noext}.bak&moveFailed=d:/temp/data/oinp/error//${date:now:yyyyMMdd}/${file:name.noext}.error

<!-- Defintion of the Camel - ActiveMq Spring config file -->
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:osgi="http://www.springframework.org/schema/osgi"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
                      http://www.springframework.org/schema/beans/spring-beans.xsd
                      http://www.springframework.org/schema/osgi
                      http://www.springframework.org/schema/osgi/spring-osgi.xsd
                      http://camel.apache.org/schema/spring
                      http://camel.apache.org/schema/spring/camel-spring.xsd">
      
    <bean id="active-mq" class="org.apache.activemq.camel.component.ActiveMQComponent">
    	<property name="transacted" value="true"/>
    	<property name="connectionFactory">
    		<osgi:reference interface="javax.jms.ConnectionFactory"/>
    	</property>
        <property name="transactionManager">
			<osgi:reference interface="org.springframework.transaction.PlatformTransactionManager"/>
		</property>
		<!-- <property name="transferExchange" value="true"/> -->
    </bean>

    <osgi:service id="osgiqueuingservice" ref="active-mq" interface="org.apache.camel.Component"/>
		       
</beans>

-----------------------------------
For Camel configuration

<!-- OSGI reference of the service used  -->
<!-- Queuing service -->
<osgi:reference id="queuingservice" interface="org.apache.camel.Component" />

<!-- TransactionErrorHandler -->
	<bean id="txErrorHandlerReqNew" class="org.apache.camel.spring.spi.TransactionErrorHandlerBuilder">
        <property name="springTransactionPolicy" ref="PROPAGATION_REQUIRED_NEW"/>
</bean>

<!-- Transaction Policy -->
<bean id="PROPAGATION_REQUIRED_NEW" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
        <property name="transactionManager">
			<osgi:reference>
				<osgi:interfaces>
					<value>org.springframework.orm.hibernate3.HibernateTransactionManager</value>
				</osgi:interfaces>
			</osgi:reference>
  		</property>
  		<property name="propagationBehaviorName" value="PROPAGATION_REQUIRES_NEW"/>
</bean> 

<!-- Full route -->
	<camel:camelContext id="InToOut" trace="true"	xmlns="http://camel.apache.org/schema/osgi">
		<camel:route errorHandlerRef="txErrorHandlerReqNew">
			<camel:from ref="fileClientEndpoint" />
			<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
			
		    <camel:onException>
	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
				<camel:bean ref="serviceHelper" method="processException" />
				<camel:to ref="queueReportingEndpoint" />
            </camel:onException>
			
			<camel:onException>
				<camel:exception>java.lang.Exception</camel:exception>
				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
				<camel:rollback/>
		    </camel:onException>

				<camel:setHeader headerName="origin">
					<camel:constant>file</camel:constant>
				</camel:setHeader>

				<!-- Set Message type header with the name of the parent folder -->
				<camel:bean ref="serviceHelper" method="getParentFolderName" />

				<camel:convertBodyTo type="java.lang.String" />
			
				<!-- Call the requestService to save the request -->
				<camel:bean ref="serviceHelper" method="createRequest" />
				
                                <!-- ERROR GENERATED FOR TESTING PURPOSE -->
				<camel:bean ref="serviceHelper" method="generateX3SClientException" />  
				<!-- <camel:bean ref="serviceHelper" method="generateException" /> -->	
				
				<camel:to ref="queueRequestEndpoint" />
		</camel:route>
{code}




      was (Author: cmoulliard):
    Is there a better command than {code} to format info in the wiki ?

Camel Version used : 2.0 and now 2.1-SNAPSHOT

Endpoints definition :

{code}
queueReportingEndpoint = uriQueueReporting=queuingservice:x3s:reporting (remark : queuingservice --> corresponds to activemq service packaged as separate osgi bundle)
queueRequestEndpoint= uriQueueRequest=queuingservice:x3s:request
fileClientEndpoint = uriFileClient=file://d:/temp/data/oinp/?delay=15000&move=d:/temp/data/oinp/backup/${date:now:yyyyMMdd}/${file:name.noext}.bak&moveFailed=d:/temp/data/oinp/error//${date:now:yyyyMMdd}/${file:name.noext}.error

<!-- Defintion of the Camel - ActiveMq Spring config file -->
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:osgi="http://www.springframework.org/schema/osgi"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
                      http://www.springframework.org/schema/beans/spring-beans.xsd
                      http://www.springframework.org/schema/osgi
                      http://www.springframework.org/schema/osgi/spring-osgi.xsd
                      http://camel.apache.org/schema/spring
                      http://camel.apache.org/schema/spring/camel-spring.xsd">
      
    <bean id="active-mq" class="org.apache.activemq.camel.component.ActiveMQComponent">
    	<property name="transacted" value="true"/>
    	<property name="connectionFactory">
    		<osgi:reference interface="javax.jms.ConnectionFactory"/>
    	</property>
        <property name="transactionManager">
			<osgi:reference interface="org.springframework.transaction.PlatformTransactionManager"/>
		</property>
		<!-- <property name="transferExchange" value="true"/> -->
    </bean>

    <osgi:service id="osgiqueuingservice" ref="active-mq" interface="org.apache.camel.Component"/>
		       
</beans>

-----------------------------------
For Camel configuration

<!-- OSGI reference of the service used  -->
<!-- Queuing service -->
<osgi:reference id="queuingservice" interface="org.apache.camel.Component" />

<!-- TransactionErrorHandler -->
	<bean id="txErrorHandlerReqNew" class="org.apache.camel.spring.spi.TransactionErrorHandlerBuilder">
        <property name="springTransactionPolicy" ref="PROPAGATION_REQUIRED_NEW"/>
</bean>

<!-- Transaction Policy -->
<bean id="PROPAGATION_REQUIRED_NEW" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
        <property name="transactionManager">
			<osgi:reference>
				<osgi:interfaces>
					<value>org.springframework.orm.hibernate3.HibernateTransactionManager</value>
				</osgi:interfaces>
			</osgi:reference>
  		</property>
  		<property name="propagationBehaviorName" value="PROPAGATION_REQUIRES_NEW"/>
</bean> 

<!-- Full route -->
	<camel:camelContext id="InToOut" trace="true"	xmlns="http://camel.apache.org/schema/osgi">
		<camel:route errorHandlerRef="txErrorHandlerReqNew">
			<camel:from ref="fileClientEndpoint" />
			<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
			
		    <camel:onException>
	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
				<camel:bean ref="serviceHelper" method="processException" />
				<camel:to ref="queueReportingEndpoint" />
            </camel:onException>
			
			<camel:onException>
				<camel:exception>java.lang.Exception</camel:exception>
				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
				<camel:rollback/>
		    </camel:onException>

				<camel:setHeader headerName="origin">
					<camel:constant>file</camel:constant>
				</camel:setHeader>

				<!-- Set Message type header with the name of the parent folder -->
				<camel:bean ref="serviceHelper" method="getParentFolderName" />

				<camel:convertBodyTo type="java.lang.String" />
			
				<!-- Call the requestService to save the request -->
				<camel:bean ref="serviceHelper" method="createRequest" />
				
                                <!-- ERROR GENERATED FOR TESTING PURPOSE -->
				<camel:bean ref="serviceHelper" method="generateX3SClientException" />  
				<!-- <camel:bean ref="serviceHelper" method="generateException" /> -->	
				
				<camel:to ref="queueRequestEndpoint" />
		</camel:route>
{code}



  
> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Charles Moulliard
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> <camel:route errorHandlerRef="txErrorHandlerReqNew">
> 	<camel:from ref="fileClientEndpoint" />
> 	<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 		
>          <camel:onException>
> 	       	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 		<camel:bean ref="serviceHelper" method="processException" />
> 		<camel:to ref="queueReportingEndpoint" />
>            </camel:onException>
> 	
> 	<camel:onException>
> 		<camel:exception>java.lang.Exception</camel:exception>
> 		<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		<camel:rollback/>
>     </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID, ...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54011#action_54011 ] 

Claus Ibsen commented on CAMEL-1965:
------------------------------------

The issue is likely Windows being bad at doing file IO operations.

{code}
16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
{code}

And SUN have a terrible Java IO API that just returns boolean false when a rename could not be performed!!! Talk about bad API design (yet again from SUN).

We may need to add a workaround in Windows to do some wait and retry when renaming files.

> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Charles Moulliard
>         Attachments: BookService.java, springTransactionalClientDataSourceUsingTransactedOnException.xml, SpringTransactionalClientDataSourceUsingTransactedOnExceptionTest.java, transactionalClientDataSource.xml
>
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> <camel:route errorHandlerRef="txErrorHandlerReqNew">
> 	<camel:from ref="fileClientEndpoint" />
> 	<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 		
>          <camel:onException>
> 	       	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 		<camel:bean ref="serviceHelper" method="processException" />
> 		<camel:to ref="queueReportingEndpoint" />
>            </camel:onException>
> 	
> 	<camel:onException>
> 		<camel:exception>java.lang.Exception</camel:exception>
> 		<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		<camel:rollback/>
>     </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID, ...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-1965:
-------------------------------

    Attachment: camel_1965.patch

Try with this patch

> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Charles Moulliard
>         Attachments: BookService.java, camel_1965.patch, springTransactionalClientDataSourceUsingTransactedOnException.xml, SpringTransactionalClientDataSourceUsingTransactedOnExceptionTest.java, transactionalClientDataSource.xml
>
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> <camel:route errorHandlerRef="txErrorHandlerReqNew">
> 	<camel:from ref="fileClientEndpoint" />
> 	<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 		
>          <camel:onException>
> 	       	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 		<camel:bean ref="serviceHelper" method="processException" />
> 		<camel:to ref="queueReportingEndpoint" />
>            </camel:onException>
> 	
> 	<camel:onException>
> 		<camel:exception>java.lang.Exception</camel:exception>
> 		<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		<camel:rollback/>
>     </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID, ...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Charles Moulliard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54021#action_54021 ] 

Charles Moulliard commented on CAMEL-1965:
------------------------------------------

Thx for the patch Claus ;-)

The issue is no more there and the file has been moved correctly. And now the ExchangeException has been well received by the bean in this route section :

{code}
<camel:onException>
<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
<camel:bean ref="serviceHelper" method="processException" />
<camel:to ref="queueReportingEndpoint" />
            </camel:onException>
{code}

> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Charles Moulliard
>         Attachments: BookService.java, file_patch.patch, springTransactionalClientDataSourceUsingTransactedOnException.xml, SpringTransactionalClientDataSourceUsingTransactedOnExceptionTest.java, transactionalClientDataSource.xml
>
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> <camel:route errorHandlerRef="txErrorHandlerReqNew">
> 	<camel:from ref="fileClientEndpoint" />
> 	<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 		
>          <camel:onException>
> 	       	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 		<camel:bean ref="serviceHelper" method="processException" />
> 		<camel:to ref="queueReportingEndpoint" />
>            </camel:onException>
> 	
> 	<camel:onException>
> 		<camel:exception>java.lang.Exception</camel:exception>
> 		<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		<camel:rollback/>
>     </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID, ...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-1965:
-------------------------------

    Attachment: file_patch.patch

A working file patch that I have actually run and tested :)

> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Charles Moulliard
>         Attachments: BookService.java, file_patch.patch, springTransactionalClientDataSourceUsingTransactedOnException.xml, SpringTransactionalClientDataSourceUsingTransactedOnExceptionTest.java, transactionalClientDataSource.xml
>
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> <camel:route errorHandlerRef="txErrorHandlerReqNew">
> 	<camel:from ref="fileClientEndpoint" />
> 	<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 		
>          <camel:onException>
> 	       	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 		<camel:bean ref="serviceHelper" method="processException" />
> 		<camel:to ref="queueReportingEndpoint" />
>            </camel:onException>
> 	
> 	<camel:onException>
> 		<camel:exception>java.lang.Exception</camel:exception>
> 		<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		<camel:rollback/>
>     </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID, ...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-1965:
-------------------------------

    Fix Version/s: 2.1.0

> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Charles Moulliard
>             Fix For: 2.1.0
>
>         Attachments: BookService.java, file_patch.patch, springTransactionalClientDataSourceUsingTransactedOnException.xml, SpringTransactionalClientDataSourceUsingTransactedOnExceptionTest.java, transactionalClientDataSource.xml
>
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> <camel:route errorHandlerRef="txErrorHandlerReqNew">
> 	<camel:from ref="fileClientEndpoint" />
> 	<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 		
>          <camel:onException>
> 	       	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 		<camel:bean ref="serviceHelper" method="processException" />
> 		<camel:to ref="queueReportingEndpoint" />
>            </camel:onException>
> 	
> 	<camel:onException>
> 		<camel:exception>java.lang.Exception</camel:exception>
> 		<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		<camel:rollback/>
>     </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID, ...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Charles Moulliard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54013#action_54013 ] 

Charles Moulliard commented on CAMEL-1965:
------------------------------------------

Yes. I'm using Windows

> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Charles Moulliard
>         Attachments: BookService.java, camel_1965.patch, springTransactionalClientDataSourceUsingTransactedOnException.xml, SpringTransactionalClientDataSourceUsingTransactedOnExceptionTest.java, transactionalClientDataSource.xml
>
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> <camel:route errorHandlerRef="txErrorHandlerReqNew">
> 	<camel:from ref="fileClientEndpoint" />
> 	<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 		
>          <camel:onException>
> 	       	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 		<camel:bean ref="serviceHelper" method="processException" />
> 		<camel:to ref="queueReportingEndpoint" />
>            </camel:onException>
> 	
> 	<camel:onException>
> 		<camel:exception>java.lang.Exception</camel:exception>
> 		<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		<camel:rollback/>
>     </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID, ...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Charles Moulliard (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Charles Moulliard updated CAMEL-1965:
-------------------------------------

    Attachment: springTransactionalClientDataSourceUsingTransactedOnException.xml
                SpringTransactionalClientDataSourceUsingTransactedOnExceptionTest.java
                BookService.java

I have added code about a unit test that we could use to understand where is the issue. Unfortunately, it is very difficult to reproduce my local environment but nevertheless, what I observe running this unit test (which succeeds) is that the file is not moved from its original location to the error folder.

> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Charles Moulliard
>         Attachments: BookService.java, springTransactionalClientDataSourceUsingTransactedOnException.xml, SpringTransactionalClientDataSourceUsingTransactedOnExceptionTest.java, transactionalClientDataSource.xml
>
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> <camel:route errorHandlerRef="txErrorHandlerReqNew">
> 	<camel:from ref="fileClientEndpoint" />
> 	<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 		
>          <camel:onException>
> 	       	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 		<camel:bean ref="serviceHelper" method="processException" />
> 		<camel:to ref="queueReportingEndpoint" />
>            </camel:onException>
> 	
> 	<camel:onException>
> 		<camel:exception>java.lang.Exception</camel:exception>
> 		<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		<camel:rollback/>
>     </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID, ...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54019#action_54019 ] 

Claus Ibsen commented on CAMEL-1965:
------------------------------------

I committed the file patch to trunk as it can help work around Windows issues in general with files.

> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Charles Moulliard
>         Attachments: BookService.java, file_patch.patch, springTransactionalClientDataSourceUsingTransactedOnException.xml, SpringTransactionalClientDataSourceUsingTransactedOnExceptionTest.java, transactionalClientDataSource.xml
>
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> <camel:route errorHandlerRef="txErrorHandlerReqNew">
> 	<camel:from ref="fileClientEndpoint" />
> 	<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 		
>          <camel:onException>
> 	       	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 		<camel:bean ref="serviceHelper" method="processException" />
> 		<camel:to ref="queueReportingEndpoint" />
>            </camel:onException>
> 	
> 	<camel:onException>
> 		<camel:exception>java.lang.Exception</camel:exception>
> 		<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		<camel:rollback/>
>     </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID, ...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,...
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,...
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1965) onException does not work correctly when used in a transacted route and exception is not send to the bean component called

Posted by "Charles Moulliard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53935#action_53935 ] 

Charles Moulliard commented on CAMEL-1965:
------------------------------------------

Is there a better command than {code} to format info in the wiki ?

Camel Version used : 2.0 and now 2.1-SNAPSHOT

Endpoints definition :

{code}
queueReportingEndpoint = uriQueueReporting=queuingservice:x3s:reporting (remark : queuingservice --> corresponds to activemq service packaged as separate osgi bundle)
queueRequestEndpoint= uriQueueRequest=queuingservice:x3s:request
fileClientEndpoint = uriFileClient=file://d:/temp/data/oinp/?delay=15000&move=d:/temp/data/oinp/backup/${date:now:yyyyMMdd}/${file:name.noext}.bak&moveFailed=d:/temp/data/oinp/error//${date:now:yyyyMMdd}/${file:name.noext}.error

<!-- Defintion of the Camel - ActiveMq Spring config file -->
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:osgi="http://www.springframework.org/schema/osgi"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
                      http://www.springframework.org/schema/beans/spring-beans.xsd
                      http://www.springframework.org/schema/osgi
                      http://www.springframework.org/schema/osgi/spring-osgi.xsd
                      http://camel.apache.org/schema/spring
                      http://camel.apache.org/schema/spring/camel-spring.xsd">
      
    <bean id="active-mq" class="org.apache.activemq.camel.component.ActiveMQComponent">
    	<property name="transacted" value="true"/>
    	<property name="connectionFactory">
    		<osgi:reference interface="javax.jms.ConnectionFactory"/>
    	</property>
        <property name="transactionManager">
			<osgi:reference interface="org.springframework.transaction.PlatformTransactionManager"/>
		</property>
		<!-- <property name="transferExchange" value="true"/> -->
    </bean>

    <osgi:service id="osgiqueuingservice" ref="active-mq" interface="org.apache.camel.Component"/>
		       
</beans>

-----------------------------------
For Camel configuration

<!-- OSGI reference of the service used  -->
<!-- Queuing service -->
<osgi:reference id="queuingservice" interface="org.apache.camel.Component" />

<!-- TransactionErrorHandler -->
	<bean id="txErrorHandlerReqNew" class="org.apache.camel.spring.spi.TransactionErrorHandlerBuilder">
        <property name="springTransactionPolicy" ref="PROPAGATION_REQUIRED_NEW"/>
</bean>

<!-- Transaction Policy -->
<bean id="PROPAGATION_REQUIRED_NEW" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
        <property name="transactionManager">
			<osgi:reference>
				<osgi:interfaces>
					<value>org.springframework.orm.hibernate3.HibernateTransactionManager</value>
				</osgi:interfaces>
			</osgi:reference>
  		</property>
  		<property name="propagationBehaviorName" value="PROPAGATION_REQUIRES_NEW"/>
</bean> 

<!-- Full route -->
	<camel:camelContext id="InToOut" trace="true"	xmlns="http://camel.apache.org/schema/osgi">
		<camel:route errorHandlerRef="txErrorHandlerReqNew">
			<camel:from ref="fileClientEndpoint" />
			<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
			
		    <camel:onException>
	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
				<camel:bean ref="serviceHelper" method="processException" />
				<camel:to ref="queueReportingEndpoint" />
            </camel:onException>
			
			<camel:onException>
				<camel:exception>java.lang.Exception</camel:exception>
				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
				<camel:rollback/>
		    </camel:onException>

				<camel:setHeader headerName="origin">
					<camel:constant>file</camel:constant>
				</camel:setHeader>

				<!-- Set Message type header with the name of the parent folder -->
				<camel:bean ref="serviceHelper" method="getParentFolderName" />

				<camel:convertBodyTo type="java.lang.String" />
			
				<!-- Call the requestService to save the request -->
				<camel:bean ref="serviceHelper" method="createRequest" />
				
                                <!-- ERROR GENERATED FOR TESTING PURPOSE -->
				<camel:bean ref="serviceHelper" method="generateX3SClientException" />  
				<!-- <camel:bean ref="serviceHelper" method="generateException" /> -->	
				
				<camel:to ref="queueRequestEndpoint" />
		</camel:route>
{code}




> onException does not work correctly when used in a transacted route and exception is not send to the bean component called
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1965
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1965
>             Project: Apache Camel
>          Issue Type: Bug
>            Reporter: Charles Moulliard
>
> Hi,
> When onException is used within a transacted route, it does not work. With the following route, the onException process does not propagate information to the from endpoint (in my case : file component). So, when X3Sexception occurs, the bean component is called where record is created in an Audit table, error message is put in a reporting queue BUT the file could not be renamed and move to temp directory. In consequence, the file is reprocessed continuously !!!!!
> {code}
> Route
> 		<camel:route errorHandlerRef="txErrorHandlerReqNew">
> 			<camel:from ref="fileClientEndpoint" />
> 			<camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
> 			
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 				<camel:rollback/>
> 		    </camel:onException>
> {code}
> {code}
> Log
> 16:51:12,896 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> from(file://d:/temp/data/oinp/?delay=15000&move=d%3A%2Ftemp%2Fdata%2Foinp%2Fbackup%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.bak&moveFailed=d%3A%2Ftemp%2Fdata%2Foinp%2Ferror%2F%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bfile%3Aname.noext%7D.error) --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:12,912 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:12,928 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException -->, Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892, CamelFileName=OINP_Example.csv, CamelFileParent=d:\temp\data\oinp, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1033 | ###### processException ######
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1046 | #### Exception received was null so create a dummy exception !
> 16:51:12,928 | INFO  | 9: FileComponent | ServiceHelper                    | ctis.x3s.core.util.ServiceHelper 1054 | >>>processException AUDIT:E9998:Error:ERR
> 16:51:12,975 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>>  --> queuingservice://x3s:reporting, Pattern:InOnly, Headers:{CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLength=892, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelBeanMethodName=null, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolute=true, CamelBeanMultiParameterArray=false, CamelFileName=OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> queuingservice://x3s:reporting --> ref:PROPAGATION_REQUIRED_NEW, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:13,068 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> ref:PROPAGATION_REQUIRED_NEW --> OnException, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> OnException --> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true, Pattern:InOnly, Headers:{CamelFileAbsolute=true, CamelFileLength=892, CamelBeanMethodName=null, CamelFileName=OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileNameOnly=OINP_Example.csv, CamelBeanMultiParameterArray=false, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileParent=d:\temp\data\oinp}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:13,084 | INFO  | 9: FileComponent | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.apache.camel.component.file.GenericFile
> , Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> ]
> 16:51:13,084 | INFO  | 9: FileComponent | TraceInterceptor                 | rg.apache.camel.processor.Logger   88 | ID-dell-charles-2415-1251709696459-0-85 >>> log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true --> Rollback, Pattern:InOnly, Headers:{CamelFileName=OINP_Example.csv, CamelBeanMethodName=null, CamelBeanMultiParameterArray=false, CamelFileParent=d:\temp\data\oinp, CamelFileNameOnly=OINP_Example.csv, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009, CamelFileAbsolute=true, CamelFileLength=892}, BodyType:org.apache.camel.component.file.GenericFile, Body:ORD_REF_ID,TNA_EMX_ID,CLI_REF_ID,ACC_REF_ID,CLI_SHT_NM,ORI_EMX_ID,AGT_ID,MUL_ORD_CD,DEA_CUR_CD,CAN_RGH_FL,ORD_DEA_SEQ_NB,TNA_PRD_TP,SEC_IDF_TP,SEC_ID,ACC_NM,INC_REI_CD,PRI_BAS_CD,GRP_IDC_CD,ORD_DRN_CD,ISA_TYP_CD,ORD_UNT_NB,ORD_CSH_AM,ORD_QTY_PT,RND_MTD_CD,FOX_RQM_FL,COM_CUR_CD,COM_PT,COM_TP,SPE_COM_PT,RNW_COM_FL,ORD_DEA_TOT_NB,RGS_NB,RGS_FIR_NM,RGS_SND_NM,RGS_THD_NM,RGS_FTH_NM,RGS_FIR_AD,RGS_SND_AD,RGS_THD_AD,RGS_FTH_AD,MIL_AD,MLS_CD,MIL_RQM_TX,RGS_FIR_BTH_DT,NIN_ID,UKR_FL,PYM_TP,CDA_HLD_NM,CDA_IDF_NB,CDA_STR_DT,CDA_EXP_DT,CDA_ISS_NB,STL_BNK_NM,STL_BNK_SRT_CD,STL_BNK_ACC_ID,STL_BNK_ACC_NM,STL_PYM_REF_ID,STL_CUR_CD,SKP_ACC_ID,SKP_SUB_ACC_ID,DIB_BNK_NM,DIB_BNK_SRT_CD,DIB_BNK_ACC_ID,DIB_BNK_ACC_NM,DIB_PYM_REF_ID,DIB_CUR_CD,SWT_CD,TUP_WDR_CD,MES_FRE_TX
> TFA92426,PRVID,,10000,,INTID,20000,1,GBP,,1,Product001,4,GBPROD001UO1,,,,,1,,,1287,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  202 | org.apache.camel.RollbackExchangeException: Intended rollback on the exchange: Exchange[GenericFileMessage with file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]]
> 16:51:13,100 | WARN  | 9: FileComponent | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  142 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@29e26 for file: GenericFile[d:\temp\data\oinp\OINP_Example.csv]
> 16:51:13,100 | ERROR | 9: FileComponent | GenericFileOnCompletion          | rg.apache.camel.processor.Logger  248 | Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\oinp\OINP_Example.csv] to: GenericFile[d:\temp\data\oinp\error\\20090831\OINP_Example.error]
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
> 	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.rollback(GenericFileRenameProcessStrategy.java:61)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyRollback(GenericFileOnCompletion.java:145)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:95)
> 	at org.apache.camel.component.file.GenericFileOnCompletion.onFailure(GenericFileOnCompletion.java:58)
> 	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:126)
> {code}
> REMARK : 
> - Exception object is not received by the bean component
> but everything works fine if the route is defined like this 
> {code}
> 		<camel:route>
> 			<camel:from ref="fileClientEndpoint" />
> 		    <camel:onException>
> 	        	<camel:exception>com.xpectis.x3s.exception.X3SClientException</camel:exception>
> 				<camel:bean ref="serviceHelper" method="processException" />
> 				<camel:to ref="queueReportingEndpoint" />
>             </camel:onException>
> 			
> 			<camel:onException>
> 				<camel:exception>java.lang.Exception</camel:exception>
> 				<camel:to uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true" />
> 		    </camel:onException>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.