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

report-maven-plugin fails to validate simple expression

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.6.0
    • Fix Version/s: 3.7.0
    • Component/s: tooling
    • Labels:
      None
    • Estimated Complexity:
      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

            • Assignee:
              Unassigned
              Reporter:
              mcollovati Marco Collovati

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment