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

simple ognl expression issue w/ list & spring boot

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.17.0, 2.17.3, 2.18.0
    • 2.18.1, 2.19.0
    • camel-spring-boot
    • None
    • Patch Available
    • Unknown
    • Patch

    Description

      conflict running simple expression w/ list under spring boot. SpringTypeConverter is registered as a fallback converter which gets picked up during ognl while attempting to convert list -> map causing an exception instead of a null response that is expected. It is happening under 2.17 & 2.18.

      sample expression: ${body.list[0].field}

      10:20:32.499 [main] TRACE o.a.c.i.c.DefaultTypeConverter | Converting java.util.ArrayList -> java.util.Map
      10:20:32.500 [main] TRACE o.a.c.i.c.DefaultTypeConverter | Using converter: org.apache.camel.impl.converter.ArrayTypeConverter@79d7035 to convert [class java.util.ArrayList=>interface java.util.Map]

      Caused by: org.apache.camel.TypeConversionException: Error during type conversion from type: java.util.ArrayList to the required type: java.util.Map with due Failed to convert from type [java.util.ArrayList<?>] to type [java.util.Map<?, ?>]
      at org.apache.camel.impl.converter.BaseTypeConverterRegistry.createTypeConversionException(BaseTypeConverterRegistry.java:629)
      at org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:150)
      at org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:121)
      at org.apache.camel.language.bean.BeanExpression$OgnlInvokeProcessor.lookupResult(BeanExpression.java:358)
      at org.apache.camel.language.bean.BeanExpression$OgnlInvokeProcessor.process(BeanExpression.java:334)
      at org.apache.camel.language.bean.BeanExpression.evaluate(BeanExpression.java:114)
      ... 55 common frames omitted
      Caused by: org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.util.ArrayList<?>] to type [java.util.Map<?, ?>]
      at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:42)
      at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:192)
      at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:176)
      at org.apache.camel.spring.boot.SpringTypeConverter.convertTo(SpringTypeConverter.java:46)
      at org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:346)
      at org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:133)
      ... 59 common frames omitted

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              dmitriyC300 Dmitriy Frolov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: