Dmitriy Frolov created CAMEL-10385:
--------------------------------------

             Summary: ognl issue w/ list expression & spring boot
                 Key: CAMEL-10385
                 URL: https://issues.apache.org/jira/browse/CAMEL-10385
             Project: Camel
          Issue Type: Bug
          Components: camel-spring-boot
    Affects Versions: 2.18.0, 2.17.3, 2.17.0
            Reporter: Dmitriy Frolov
            Priority: Minor


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 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to