Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I am trying to implement validation and exception handling on my route in the right way but I have some problems.
Here what I did (Talend Data Platform, 6.2.1):
Exception error = exchange.getProperty("CamelExceptionCaught", Exception.class); exchange.getOut().setHeaders(exchange.getIn().getHeaders()); exchange.getOut().setHeader("ExceptionType",error.getClass().getCanonicalName()); exchange.getOut().setHeader("ExceptionMessage",error.getMessage()); exchange.getOut().setBody(exchange.getIn().getBody());
The problem is that in "ExceptionMessage" I don't see only the Errors (as I expected) but also a lot of Warnings before (85!!!!!).
Ex.
Exception Type: org.talend.transform.camel.TdmException Exception Message: Overall: Error 1: Info - Executing map. (328) Map: /TALEND_DQ_20180312_093614/Maps/Routes/Receipt/SNATT_2_UBL Properties: {CamelFileName=SNATT_receipt_20180312084044899.xml, CamelFileNameProduced=/opt/Talend-6.2.1/backup/snatt/receipt/SNATT_receipt_20180312084044899.xml, SnattConfig=file:///opt/Talend-6.2.1/conf/snatt_config.json} 2: Warning - An element appeared in a JSON document that was not present in the structure. If this element is a JSON value, consider selecting the Name is Value element property. (1401) Enclosing [Map] Element : Map: Maps/Routes/Receipt/SNATT_2_UBL.xml - Map Element: in$/root/config/config/language_mapping countries 3: Warning - An element appeared in a JSON document that was not present in the structure. If this element is a JSON value, consider selecting the Name is Value element property. (1401) Enclosing [Map] Element : <none> country [...] 83: Warning - An element appeared in a JSON document that was not present in the structure. If this element is a JSON value, consider selecting the Name is Value element property. (1401) Enclosing [Map] Element : <none> country 84: Warning - An element appeared in a JSON document that was not present in the structure. If this element is a JSON value, consider selecting the Name is Value element property. (1401) Enclosing [Map] Element : <none> language 85: Warning - An element appeared in a JSON document that was not present in the structure. If this element is a JSON value, consider selecting the Name is Value element property. (1401) Enclosing [Map] Element : Map: Maps/Routes/Receipt/SNATT_2_UBL.xml - Map Element: in$/root/config/config/language_mapping default 86: Error - A validation expression returned false. (305) (INPUT) Map: /TALEND_DQ_20180312_093614/Maps/Routes/Receipt/SNATT_2_UBL.xml - Map Element: in$/root/root/Header/Details/NumeroPO
In this way it is very difficult to recognize the exception.
Therefore I have two questions:
Thank you in advance.
Manuel
Hello,
Are you able to use cOnException component to catch your errors in your route?
Could you please try to set the log level of the cMap component to "None" and Exception Threshold to "Fatal" to see if these info and warnings are printed on console?
Best regards
Sabrina
Hello Sabrina,
thank you for you answer. Unfortunately the solution you provided didn't solve my problem.
I replaced the cTry with a cOnException structure, I set the Log Level and the Exception Threshold as you suggested but info and warnings are still there.
I also tried to modify the structure of the JSON part to get rid of all this warnings but every attempt was useless.
Any other suggestion?
Thank you in advance,
Manuel
Hello,
With your Talend Data Platform, 6.2.1 subscription solution, could you please create a case on talend support portal so that our colleagues from support team will schedule a webex session to check your issue to see if it is a bug on V 6.2 through support cycle with priority?
Best regards
Sabrina