Marco Collovati created CAMEL-15811:
---------------------------------------

             Summary: report-maven-plugin fails to validate simple expression
                 Key: CAMEL-15811
                 URL: https://issues.apache.org/jira/browse/CAMEL-15811
             Project: Camel
          Issue Type: Bug
          Components: tooling
    Affects Versions: 3.6.0
            Reporter: Marco Collovati


Starting from camel 3.6, **camel-report-maven-plugin validate goal**  fails to 
validate simple expressions; on console log I see an error *[null]* for every 
expression, also simple ones like *${body.id}*.

Debugging a bit I found that error is due to a NPE on the *ExpressionAdapter* 
created
 in *SimpleExpressionBuilder.bodyOgnlExpression*, and more specifically in the 
 *init* method, that uses *CamelContext* to resolve bean language.


 When running from maven goal execution, at a certain point, init method is 
called with a null CamelContext reference and this causes the NPE.

Below an extract of the stacktrace

 
{noformat}
 java.lang.NullPointerException
 at 
org.apache.camel.language.simple.SimpleExpressionBuilder$28.init(SimpleExpressionBuilder.java:761)
 at 
org.apache.camel.language.simple.ast.SimpleFunctionExpression.createExpression(SimpleFunctionExpression.java:61)
 at 
org.apache.camel.language.simple.ast.SimpleFunctionStart.doCreateLiteralExpression(SimpleFunctionStart.java:70)
 at 
org.apache.camel.language.simple.ast.SimpleFunctionStart.createExpression(SimpleFunctionStart.java:60)
 at 
org.apache.camel.language.simple.SimpleExpressionParser.createExpressions(SimpleExpressionParser.java:165)
 at 
org.apache.camel.language.simple.SimpleExpressionParser.doParseExpression(SimpleExpressionParser.java:88)
 at 
org.apache.camel.language.simple.SimpleExpressionParser.parseExpression(SimpleExpressionParser.java:55)
 at 
org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:132)
{noformat}
In 3.5 **init** method was nor overridden by the *ExpressionAdapter* nor 
invoked in *SimpleFunctionExpression.createExpression*.

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to