Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-15811

report-maven-plugin fails to validate simple expression

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.6.0
    • 3.7.0
    • tooling
    • None
    • Unknown

    Description

      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

       

       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)
      

      In 3.5 *init* method was nor overridden by the ExpressionAdapter nor invoked in SimpleFunctionExpression.createExpression.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            mcollovati Marco Collovati
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: