When using json-logger after a foreach that iterates an empty collection(which is valid). The log will output the following stacktrace:
Message : next on empty iterator
Element : basic-test/processors/1/processors/0 @ test:test.xml:82
Element DSL : <logger message="#[payload]"></logger>
Error type : MULE:UNKNOWN
FlowStack : at basic-test(basic-test/processors/3 @ test:test.xml:86 (EkkND))
--------------------------------------------------------------------------------
Root Exception stack trace:
java.util.NoSuchElementException: next on empty iterator
at scala.collection.Iterator$$anon$2.next(Iterator.scala:41)
at scala.collection.Iterator$$anon$2.next(Iterator.scala:39)
at scala.collection.immutable.StreamIterator.next(Stream.scala:1057)
No ERROR is actually thrown in the flow, the flow will continue to process normally. However, it seems the json-logger is dredging up some suppressed error or something and filling the logs and making it look like an error actually occurred. If you use the example below, 'NO ERROR ACTUALLY HAPPENED' will still execute and log, but it will also log the stack trace above.
NOTE: This only happens withjson-logger. Remove the json-logger or replace it with something else and there is no stack trace in the logs
When using
json-logger
after aforeach
that iterates an empty collection(which is valid). The log will output the following stacktrace:No ERROR is actually thrown in the flow, the flow will continue to process normally. However, it seems the
json-logger
is dredging up some suppressed error or something and filling the logs and making it look like an error actually occurred. If you use the example below, 'NO ERROR ACTUALLY HAPPENED' will still execute and log, but it will also log the stack trace above.NOTE: This only happens with
json-logger
. Remove the json-logger or replace it with something else and there is no stack trace in the logs