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

ExpressionBuilder.headerExpression("name", class) results in ClassNotFoundException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.3.0
    • Component/s: came-core
    • Labels:
      None
    • Estimated Complexity:
      Unknown
    • Regression:
      Regression

      Description

       public static <T> Expression headerExpression(final String headerName, final Class<T> type) {
           return headerExpression(simpleExpression(headerName), constantExpression(type));
      {{ }}}

       

      and

       

      {{ public static Expression headerExpression(final Expression headerName, final Expression typeName)}}
      }}{{

      tries to resolve the type via

      String text = typeName.evaluate(exchange, String.class);

      which results in the String "class xxx.yyy.type". Trying to resolve that as a class obviously is bound to fail. I'm not sure whether the type converter should be changed here or the headerExpression code is wrong.

       

      This worked in 3.1.0, btw.

        Attachments

        1. camel-header-expression.diff
          2 kB
          Jens Kleine-Herzbruch

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              jensgr@gmx.net Jens Kleine-Herzbruch
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: