Smooks Bean is null in Freemarker Expression

Solution In Progress - Updated -

Issue

We are developing a Smooks project with freemarker expressions and apparently the bean is undefined at the expression level, although it was added previously to the beans on Smooks BeanContext.

As far as we know we should access an added Bean( “x” ) through :

        <ftl:template><!--<#ftl ns_prefixes={"S":"urn:sample:com:xsd:pain.001"}>
${x}
--></ftl:template>

But an exception is thrown reporting that x is not a known expression:

ERROR [freemarker.runtime] (Camel (camel-8) thread #8 - file:///input) Template processing error: "Expression x is undefined on line 2, column 3 in free-marker-template.": freemarker.core.InvalidReferenceException: Expression x is undefined on line 2, column 3 in free-marker-template.
    at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
    at freemarker.core.Expression.getStringValue(Expression.java:118)
    at freemarker.core.Expression.getStringValue(Expression.java:93)
    at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
    at freemarker.core.Environment.visit(Environment.java:221)
    at freemarker.core.MixedContent.accept(MixedContent.java:92)
    at freemarker.core.Environment.visit(Environment.java:221)
    at freemarker.core.Environment.process(Environment.java:199)
    at freemarker.template.Template.process(Template.java:259)

Environment

  • Red Hat JBoss Fuse (on EAP)
    • 6.2.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.