camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CAMEL-9022) JacksonTypeConverter breaks CSV marshalling
Date Mon, 27 Jul 2015 12:37:04 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-9022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Claus Ibsen resolved CAMEL-9022.
--------------------------------
    Resolution: Fixed
      Assignee: Claus Ibsen

Fixed CAMEL-8554 to not be enabled by default.

> JacksonTypeConverter breaks CSV marshalling
> -------------------------------------------
>
>                 Key: CAMEL-9022
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9022
>             Project: Camel
>          Issue Type: Bug
>            Reporter: Thomas Diesler
>            Assignee: Claus Ibsen
>             Fix For: 2.16
>
>
> Marshalling a Map to CSV internally converts a Map to a List. It seems that the JacksonTypeConverters
now claim to be able to this. It however fails with 
> {code}
> Caused by: org.apache.camel.TypeConversionException: Error during type conversion from
type: java.lang.String to the required type: java.util.List with value {firstName=John, lastName=Doe}
due java.lang.IllegalArgumentException: Can not deserialize instance of java.util.ArrayList
out of START_OBJECT token
>  at [Source: N/A; line: -1, column: -1]
> 	at org.apache.camel.impl.converter.BaseTypeConverterRegistry.createTypeConversionException(BaseTypeConverterRegistry.java:585)
> 	at org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:131)
> 	at org.apache.camel.util.ExchangeHelper.convertToType(ExchangeHelper.java:203)
> 	at org.apache.camel.dataformat.csv.CsvMarshaller.marshal(CsvMarshaller.java:77)
> 	at org.apache.camel.dataformat.csv.CsvDataFormat.marshal(CsvDataFormat.java:78)
> 	at org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:83)
> 	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
> 	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:454)
> 	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
> 	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
> 	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)
> 	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
> 	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
> 	at org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:68)
> 	at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:404)
> 	at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:372)
> 	at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:262)
> 	at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:372)
> 	at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:230)
> 	at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:128)
> 	at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:132)
> 	... 147 more
> Caused by: org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException:
Can not deserialize instance of java.util.ArrayList out of START_OBJECT token
>  at [Source: N/A; line: -1, column: -1]
> 	at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1642)
> 	at org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:1247)
> 	at org.apache.camel.impl.converter.StaticMethodFallbackTypeConverter.convertTo(StaticMethodFallbackTypeConverter.java:62)
> 	at org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:327)
> 	at org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:114)
> 	... 166 more
> Caused by: java.lang.IllegalArgumentException: Can not deserialize instance of java.util.ArrayList
out of START_OBJECT token
>  at [Source: N/A; line: -1, column: -1]
> 	at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:3286)
> 	at com.fasterxml.jackson.databind.ObjectMapper.convertValue(ObjectMapper.java:3212)
> 	at org.apache.camel.component.jackson.converter.JacksonTypeConverters.convertTo(JacksonTypeConverters.java:44)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:483)
> 	at org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:1243)
> 	... 169 more
> Caused by: com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance
of java.util.ArrayList out of START_OBJECT token
>  at [Source: UNKNOWN; line: -1, column: -1]
> 	at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148)
> 	at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:835)
> 	at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:831)
> 	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.handleNonArray(CollectionDeserializer.java:283)
> 	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:222)
> 	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:212)
> 	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:25)
> 	at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:3281)
> 	... 176 more
> {code}
> CrossRef: https://github.com/wildfly-extras/wildfly-camel/issues/784



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

Mime
View raw message