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

autoDiscoverObjectMapper is not propagated to JacksonDataFormat

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.3.0
    • 3.4.1, 3.5.0
    • camel-jackson
    • None
    • Unknown

    Description

      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:

      json.setAutoDiscoverObjectMapper("true"); 

      but it has no affect, indicated by an exception on Java Time deserialization and a message in logs:

      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') 

       

      Attachments

        1. camel-object-mapper.zip
          10 kB
          Bogdan Ilchyshyn

        Activity

          People

            davsclaus Claus Ibsen
            orange-buffalo Bogdan Ilchyshyn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: