I have noticed a strange behavior in version 2.25.2 of Camel-FreeMarker and I am wondering if it is a bug from the library. It does not happen with version 2.25.1 or other 2.xx.x versions.
The following error happens during unit tests :
SEVERE: Error executing FreeMarker template
FreeMarker template error:
The following has evaluated to null or missing:
==> exchange [in template "email.ftl" at line 5, column 55]
The template email.ftl contains :
"${exchange.properties.CamelExceptionCaught.message}"
According to Camel-FreeMarker documentation, "exchange" and "exchange.properties" should be valid identifiers in the template.
For now, my solution is to use version 2.25.1 instead of 2.25.2, but I am wondering if there is an other solution.
This have been disabled by default in 2.25.2
and 3.4.0
with CAMEL-15050 in all Apache Camel templating components because of security concerns. To enable older behavior, you can use option allowContextMapAll=true
.
See Camel Freemarker 2.25.x docs:
allowContextMapAll - Sets whether the context map should allow access to all details. By default only the message body and headers can be accessed. This option can be enabled for full access to the current Exchange and CamelContext. Doing so impose a potential security risk as this opens access to the full power of CamelContext API.