Skip to content

CAMEL-22857: Fix issues found during Jackson 3 migration review#21921

Closed
gnodet wants to merge 9 commits into
apache:mainfrom
gnodet:fix/jackson3-review-fixes
Closed

CAMEL-22857: Fix issues found during Jackson 3 migration review#21921
gnodet wants to merge 9 commits into
apache:mainfrom
gnodet:fix/jackson3-review-fixes

Conversation

@gnodet

@gnodet gnodet commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up fixes for the Jackson 3 migration (#21800). These address issues found during code review.

Fixes included:

  • Salesforce JsonUtils: Restore WRITE_DATES_AS_TIMESTAMPS and ADJUST_DATES_TO_CONTEXT_TIME_ZONE using Jackson 3's DateTimeFeature — without this, dates serialize as numeric timestamps
  • ServiceNow ServiceNowConfiguration: Restore custom date/time format serializers using the user's dateFormat/timeFormat/dateTimeFormat config properties, which became dead code after migration
  • CBOR CBORDataFormat: Fix registry lookup to find ObjectMapper instances (not TokenStreamFactory) so users with registered CBORMapper are still auto-discovered; consolidate repeated rebuild().build() into single call
  • Micrometer MicrometerModule: Remove dead throws IOException and try-catch from serializer methods (Jackson 3 uses unchecked exceptions)
  • Salesforce exception handling: Restore try-catch in AbstractDTOBase.toString(), LoginConfigHelper, StreamingApiConsumer, and DefaultBulkApiV2Client — Jackson 3's unchecked JacksonException was causing lost error handling

Context

See review comment: #21800 (comment)

This PR should be merged after #21800.

cunningt and others added 9 commits March 9, 2026 13:45
Replace the explicit jackson-annotations managed dependency with a
Jackson 2 BOM import. This ensures all Jackson 2 artifacts (annotations,
core, databind) stay coherent at the same version.

Previously, only jackson-annotations was managed at 2.20 while
jackson-databind was unmanaged, causing langchain4j (which transitively
brings jackson-databind 2.21.1) to fail with NoClassDefFoundError for
JsonSerializeAs (introduced in annotations 2.21).

Also bumps jackson2-version from 2.20.2 to 2.21.1 to match the version
used by transitive dependencies like langchain4j.
Replace ${jackson2-annotations-version} with ${jackson2-version} in
camel-jbang-mcp since the property was removed in favour of the
Jackson 2 BOM import.
The Jackson 2 BOM must be imported before the Jackson 3 BOM in
dependencyManagement. Maven resolves managed versions from the first
BOM that declares them. The Jackson 3 BOM pins
com.fasterxml.jackson.core:jackson-annotations to 2.20 for backward
compatibility, but transitive dependencies (langchain4j, twilio)
require 2.21.x. Importing the Jackson 2 BOM first ensures all Jackson
2 artifacts resolve at ${jackson2-version} (2.21.1).
…ang-mcp

jackson-annotations uses a different versioning scheme since 2.20 (no
patch version), so jackson-annotations:2.21.1 does not exist. Remove the
explicit version so the Jackson 2 BOM manages it correctly to 2.21.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…n3-avro

Remove the local Jackson 3 BOM import from camel-jackson3-avro. The
parent POM already imports both Jackson 2 and Jackson 3 BOMs in the
correct order (Jackson 2 first). The local import was overriding
jackson-annotations to 2.20 (from Jackson 3 BOM) while jackson-databind
remained at 2.21.1 (from parent's Jackson 2 BOM). Since jackson-databind
2.21.1 requires jackson-annotations 2.21 (for JsonSerializeAs), this
caused NoClassDefFoundError at runtime.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Salesforce JsonUtils: restore WRITE_DATES_AS_TIMESTAMPS and
  ADJUST_DATES_TO_CONTEXT_TIME_ZONE (moved to DateTimeFeature in Jackson 3)
- ServiceNow: restore custom date/time format serializers using
  dateFormat/timeFormat/dateTimeFormat config properties
- CBOR: fix registry lookup to find ObjectMapper (not TokenStreamFactory),
  and consolidate repeated rebuild().build() into single call
- Micrometer: remove dead IOException throws and try-catch from
  serializer methods (Jackson 3 uses unchecked exceptions)
- Salesforce: restore exception handling in AbstractDTOBase.toString(),
  LoginConfigHelper, StreamingApiConsumer, DefaultBulkApiV2Client

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@gnodet

gnodet commented Mar 11, 2026

Copy link
Copy Markdown
Contributor Author

Pushed fixes directly to #21800 instead.

@gnodet gnodet closed this Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment