[ 
https://issues.apache.org/jira/browse/CAMEL-10385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15570944#comment-15570944
 ] 

ASF GitHub Bot commented on CAMEL-10385:
----------------------------------------

GitHub user dmitriyC300 opened a pull request:

    https://github.com/apache/camel/pull/1209

    CAMEL-10385: springtypeconverter return null on list -> map

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dmitriyC300/camel CAMEL-10385

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/1209.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1209
    
----
commit de208e8c9d8a60e8c2738932707cd638865bb5f2
Author: dmitriy <xhu...@gmail.com>
Date:   2016-10-13T05:37:50Z

    CAMEL-10385: springtypeconverter return null on list -> map

----


> simple ognl expression issue w/ list & 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.17.0, 2.17.3, 2.18.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