Federico Mariani created CAMEL-24064:
----------------------------------------

             Summary: camel-jackson3: type converter drops all but the last 
configured Jackson module and transformers let JacksonException escape unwrapped
                 Key: CAMEL-24064
                 URL: https://issues.apache.org/jira/browse/CAMEL-24064
             Project: Camel
          Issue Type: Bug
          Components: camel-jackson
    Affects Versions: 4.19.0
            Reporter: Federico Mariani


Two regressions from the Jackson 2 to Jackson 3 port (CAMEL-22857) in 
camel-jackson3:

1. {{JacksonTypeConverters.resolveObjectMapper()}}: when 
{{CamelJacksonTypeConverterModuleClassNames}} contains multiple module class 
names, each loop iteration replaces the mapper with a fresh 
{{JsonMapper.builder().addModule(module).build()}}, so only the last module 
ends up registered. camel-jackson (Jackson 2) accumulates all modules via 
{{registerModule}}.

2. {{JsonStructDataTypeTransformer}} and {{JsonPojoDataTypeTransformer}} were 
not migrated to Jackson 3's unchecked {{JacksonException}} (their catch clauses 
still reference {{IOException}}, which Jackson 3 read/write calls no longer 
throw). Malformed JSON therefore escapes as a raw {{JacksonException}} instead 
of being wrapped in {{CamelExecutionException}} with the exchange attached, as 
{{JsonDataTypeTransformer}} already does.

Note: camel-jackson3 was introduced in 4.19.0, so the fix only applies to main 
(no 4.18.x backport).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to