Bogdan Ilchyshyn created CAMEL-15229:
----------------------------------------

             Summary: autoDiscoverObjectMapper is not propagated to 
JacksonDataFormat
                 Key: CAMEL-15229
                 URL: https://issues.apache.org/jira/browse/CAMEL-15229
             Project: Camel
          Issue Type: Bug
          Components: camel-jackson
    Affects Versions: 3.3.0
            Reporter: Bogdan Ilchyshyn
         Attachments: camel-object-mapper.zip

When {{autoDiscoverObjectMapper}} is set on {{JsonDataFormat}} definition, it 
is not propagated to {{JacksonDataFormat}}. Looking at the code in 
{{JsonDataFormatReifier}} I was not able to see this property in the list of 
populated properties.

 

Please see attachment for the reproducer project. {{ObjectMapperTest}} 
demonstrates the issue. In the route builder we set:
{code:java}
json.setAutoDiscoverObjectMapper("true"); {code}
but it has no affect, indicated by an exception on Java Time deserialization 
and a message in logs:
{noformat}
o.a.c.c.jackson.JacksonDataFormat        : The option autoDiscoverObjectMapper 
is set to false, Camel won't search in the registry
...
Exhausted after delivery attempt: 1 caught: 
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct 
instance of `java.time.LocalDate` (no Creators, like default construct, exist): 
no String-argument constructor/factory method to deserialize from String value 
('2077-01-01') {noformat}
 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to