Federico Mariani created CAMEL-24162:
----------------------------------------
Summary: camel-jacksonxml - moduleClassNames DSL option crashes
route creation (reifier typo 'modulesClassNames')
Key: CAMEL-24162
URL: https://issues.apache.org/jira/browse/CAMEL-24162
Project: Camel
Issue Type: Bug
Components: camel-jacksonxml
Reporter: Federico Mariani
Attachments: JacksonXMLModuleClassNamesReifierIssueTest.java
*Severity:* High
*Affects:* all 4.x (typo since the JacksonXML data format was added)
h3. Problem
{{JacksonXMLDataFormatReifier.prepareDataFormatConfig}} transfers the model
option under a misspelled key:
{code:java}
properties.put("modulesClassNames", definition.getModuleClassNames()); //
should be "moduleClassNames"
{code}
The {{JacksonXMLDataFormat}} class and its generated configurer only accept
{{moduleClassNames}}. Because {{DataFormatReifier.configureDataFormat}} binds
with {{withMandatory(true)}}, the unmatched key throws
{{PropertyBindingException}} at route startup.
h3. Failure scenario
{code:xml}
<marshal><jacksonXml
moduleClassNames="com.fasterxml.jackson.datatype.jsr310.JavaTimeModule"/></marshal>
{code}
{noformat}
FailedToCreateRoute ... Error binding property (modulesClassNames=...) with
name: modulesClassNames
on bean: org.apache.camel.component.jacksonxml.JacksonXMLDataFormat
at DataFormatReifier.configureDataFormat(DataFormatReifier.java:316)
{noformat}
The JSON twin was fixed long ago (commit {{eb2f171ff39f}}) but the XML reifier
was missed. The same reifier serves *camel-jackson3xml*, which is equally
broken.
h3. Suggested fix
{{properties.put("moduleClassNames", definition.getModuleClassNames());}}
h3. Reproducer
Attached {{JacksonXMLModuleClassNamesReifierIssueTest.java}} builds a route via
the {{JacksonXMLDataFormat}} model with {{moduleClassNames}} set and asserts
the context starts; RED on current code (PropertyBindingException on
{{modulesClassNames}}).
----
_Reported by Claude Code on behalf of Federico Mariani (Croway). A failing
JUnit reproducer (confirmed RED on 4.22.0-SNAPSHOT) is attached._
--
This message was sent by Atlassian Jira
(v8.20.10#820010)