Skip to content

Phase 8: Jackson 2 → Jackson 3 migration#254

Merged
jwijgerd merged 9 commits into
mainfrom
copilot/implement-phase-8-jackson-3-migration
Mar 26, 2026
Merged

Phase 8: Jackson 2 → Jackson 3 migration#254
jwijgerd merged 9 commits into
mainfrom
copilot/implement-phase-8-jackson-3-migration

Conversation

Copilot AI commented Mar 17, 2026

Copy link
Copy Markdown
Contributor
  • Phase 8.1: BOM & POM Dependency Changes — All complete
  • Phase 8.2: Core Jackson 2→3 Java Import Migration (shared module) — All complete
  • Phase 8.3: Runtime Module Migration — All complete
  • Phase 8.4: Client, Query-Support, EventCatalog production code migration — All complete
  • Phase 8.5: Test File Migration — All complete
  • Phase 8.6: Build Verification — Full mvn compile test-compile passes
  • Phase 8.7: Code cleanup — Removed unused ObjectMapper variables and dead code in test files
  • Phase 8.8: Test Suite Execution — Not yet run

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 5 commits March 17, 2026 14:21
- Update jackson.version from 2.21.1 to 3.1.0
- Change BOM import groupId from com.fasterxml.jackson to tools.jackson
- Change jackson-databind groupId to tools.jackson.core (shared, eventcatalog)
- Change jackson-dataformat-protobuf groupId to tools.jackson.dataformat (shared, runtime, client)
- Rename spring-boot-jackson2 to spring-boot-jackson (runtime, client, query-support)
- Keep jackson-annotations at com.fasterxml.jackson.core (backward compat in Jackson 3)
- Update all com.fasterxml.jackson.core imports to tools.jackson.core
- Update all com.fasterxml.jackson.databind imports to tools.jackson.databind
- Update all com.fasterxml.jackson.dataformat imports to tools.jackson.dataformat
- Preserve com.fasterxml.jackson.annotation imports (compatibility)
- JsonProcessingException -> JacksonException (unchecked)
- SerializerProvider -> SerializationContext
- JsonSerializer -> ValueSerializer
- Module -> JacksonModule
- BeanSerializerModifier -> ValueSerializerModifier
- BeanDeserializerModifier -> ValueDeserializerModifier
- BeanDescription -> BeanDescription.Supplier in modifier methods
- StringDeserializer moved to deser.jdk subpackage
- ObjectMapper -> JsonMapper for concrete instantiation
- Remove throws IOException where JacksonException is now unchecked
- Update SetupContext methods: addBeanSerializerModifier -> addSerializerModifier
- Update SetupContext methods: addBeanDeserializerModifier -> addDeserializerModifier
- Package changes: com.fasterxml.jackson.core/databind/dataformat -> tools.jackson.*
- JsonProcessingException -> JacksonException (unchecked), removed throws declarations
- JsonMappingException -> DatabindException (unchecked), removed throws declarations
- new ObjectMapper() -> new JsonMapper()
- Jackson2ObjectMapperBuilderCustomizer -> JsonMapperBuilderCustomizer
- Jackson2ObjectMapperBuilder -> JsonMapper.builder() pattern
- builder.modulesToInstall/serializerByType -> SimpleModule + builder.addModule
- ProtobufMapper/Schema imports updated to tools.jackson.dataformat.protobuf
- com.fasterxml.jackson.annotation imports kept (backward compatible)
…modules, bulk-migrate client/query-support/eventcatalog/test-apps imports, fix auto-configuration customizers

Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>
Copilot AI changed the title [WIP] Add phase 8 of the Jackson 3 migration Phase 8: Jackson 2 → Jackson 3 migration Mar 17, 2026
Copilot AI requested a review from jwijgerd March 17, 2026 15:05
@jwijgerd

Copy link
Copy Markdown
Contributor

@copilot you have a compilation failure, pls continue the work

Error: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.15.0:compile (default-compile) on project akces-client: Compilation failure
Error: /home/runner/work/akces-framework/akces-framework/main/client/src/main/java/org/elasticsoftware/akces/client/AkcesClientController.java:[557,11] exception java.io.IOException is never thrown in body of corresponding try statement
Error: -> [Help 1]
Error:
Error: To see the full stack trace of the errors, re-run Maven with the -e switch.
Error: Re-run Maven using the -X switch to enable full debug logging.
Error:
Error: For more information about the errors and possible solutions, please read the following articles:
Error: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Error:
Error: After correcting the problems, you can resume the build with the command
Error: mvn -rf :akces-client
Error: Process completed with exit code 1.

…apperBuilder→JsonMapper.builder(), fix auto-config customizers

Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>

Copilot AI commented Mar 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot you have a compilation failure, pls continue the work

Error: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.15.0:compile (default-compile) on proj...

Fixed in e43fc2e. The compilation failure was caused by Jackson 3's JacksonException being unchecked (RuntimeException), making catch (IOException e) invalid where only Jackson operations were in the try block. Changes:

  • AkcesClientController: catch (IOException)catch (JacksonException), removed throws IOException from deserialize()
  • AkcesDatabaseModelAutoConfiguration: Fixed customizer to use builder.addModule() instead of modulesToInstall()/serializerByType()
  • All test files: Replaced Jackson2ObjectMapperBuilder with JsonMapper.builder().addModule(...) pattern
  • Removed cascading try/catch IOException wrappers in DatabaseModelRuntimeTests and QueryModelRuntimeTests

Full mvn compile test-compile now passes across the entire project.

@jwijgerd
jwijgerd marked this pull request as ready for review March 17, 2026 16:44
Copilot AI review requested due to automatic review settings March 17, 2026 16:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the Akces framework (core modules + test apps) from Jackson 2 (com.fasterxml.jackson.*) to Jackson 3 (tools.jackson.*) and updates Spring Boot JSON customization to Spring Boot 4 / Spring Framework 7 conventions.

Changes:

  • Update Maven dependency management and module POMs to use the tools.jackson BOM and Jackson 3 artifacts (and spring-boot-jackson).
  • Replace Jackson 2 APIs/usages with Jackson 3 equivalents (exceptions, serializers/modifiers, mapper setup).
  • Update test utilities and auto-configurations to build/customize mappers via JsonMapper / JsonMapperBuilderCustomizer + SimpleModule.

Reviewed changes

Copilot reviewed 57 out of 57 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test-apps/crypto-trading/queries/src/test/java/org/elasticsoftware/cryptotrading/TestUtils.java Switch test ObjectMapper setup to JsonMapper + SimpleModule and update imports.
test-apps/crypto-trading/queries/src/main/java/org/elasticsoftware/cryptotrading/query/WalletQueryModelState.java Update @JsonSerialize import to Jackson 3 namespace.
test-apps/crypto-trading/queries/src/main/java/org/elasticsoftware/cryptotrading/query/OrdersQueryModelState.java Update @JsonSerialize import to Jackson 3 namespace.
test-apps/crypto-trading/commands/src/test/java/org/elasticsoftware/cryptotrading/TestUtils.java Switch test ObjectMapper setup to JsonMapper + SimpleModule and update imports.
test-apps/crypto-trading/aggregates/src/test/java/org/elasticsoftware/cryptotrading/TestUtils.java Switch test ObjectMapper setup to JsonMapper + SimpleModule and update imports.
test-apps/crypto-trading/aggregates/src/test/java/org/elasticsoftware/cryptotrading/SellTradeTest.java Update ObjectMapper import to Jackson 3 namespace.
test-apps/crypto-trading/aggregates/src/test/java/org/elasticsoftware/cryptotrading/BuyTradeTest.java Update ObjectMapper import to Jackson 3 namespace.
main/shared/src/test/java/org/elasticsoftware/akces/serialization/BigDecimalSerializerTests.java Build test mapper via JsonMapper.builder() and remove checked-exception signatures.
main/shared/src/test/java/org/elasticsoftware/akces/gdpr/jackson/AkcesGDPRModuleTests.java Update Version import to Jackson 3 namespace.
main/shared/src/main/java/org/elasticsoftware/akces/serialization/SchemaRecordSerde.java Migrate serde exception handling and imports to Jackson 3.
main/shared/src/main/java/org/elasticsoftware/akces/serialization/ProtocolRecordSerde.java Migrate serde exception handling and imports to Jackson 3.
main/shared/src/main/java/org/elasticsoftware/akces/serialization/BigDecimalSerializer.java Update serializer API types/exceptions for Jackson 3.
main/shared/src/main/java/org/elasticsoftware/akces/serialization/AkcesControlRecordSerde.java Update serde exception handling and imports to Jackson 3.
main/shared/src/main/java/org/elasticsoftware/akces/schemas/JsonSchema.java Update core schema parsing/serialization to Jackson 3 APIs/exceptions.
main/shared/src/main/java/org/elasticsoftware/akces/gdpr/jackson/PIIDataSerializerModifier.java Migrate serializer modifier types to Jackson 3 equivalents.
main/shared/src/main/java/org/elasticsoftware/akces/gdpr/jackson/PIIDataJsonSerializer.java Migrate custom serializer base/types to Jackson 3 equivalents.
main/shared/src/main/java/org/elasticsoftware/akces/gdpr/jackson/PIIDataJsonDeserializer.java Migrate custom deserializer base/types to Jackson 3 equivalents.
main/shared/src/main/java/org/elasticsoftware/akces/gdpr/jackson/PIIDataDeserializerModifier.java Migrate deserializer modifier types to Jackson 3 equivalents.
main/shared/src/main/java/org/elasticsoftware/akces/gdpr/jackson/AkcesGDPRModule.java Convert module base class + setup API to Jackson 3 (JacksonModule).
main/shared/pom.xml Switch Jackson dependencies to tools.jackson.* groupIds.
main/runtime/src/test/java/org/elasticsoftware/akcestest/state/RocksDBAggregateStateRepositoryTests.java Use JsonMapper in tests and update imports.
main/runtime/src/test/java/org/elasticsoftware/akcestest/schemas/JsonSchemaTests.java Remove Jackson2ObjectMapperBuilder; build mapper via JsonMapper + modules.
main/runtime/src/test/java/org/elasticsoftware/akcestest/protocol/ProtocolTests.java Update exception type usage to Jackson 3 (DatabindException/unchecked).
main/runtime/src/test/java/org/elasticsoftware/akcestest/control/AkcesAggregateControllerTests.java Use JsonMapper in tests and remove checked-exception signatures.
main/runtime/src/test/java/org/elasticsoftware/akcestest/WalletTests.java Update ObjectMapper import to Jackson 3 namespace.
main/runtime/src/test/java/org/elasticsoftware/akcestest/WalletConfiguration.java Switch to JsonMapperBuilderCustomizer and module-based serializer registration.
main/runtime/src/test/java/org/elasticsoftware/akcestest/TestUtils.java Replace Jackson2ObjectMapperBuilder with JsonMapper + modules in tests.
main/runtime/src/test/java/org/elasticsoftware/akcestest/RuntimeTests.java Replace Jackson2ObjectMapperBuilder with JsonMapper + modules; update exception types.
main/runtime/src/test/java/org/elasticsoftware/akcestest/AccountTests.java Remove checked Jackson exception declaration and update imports.
main/runtime/src/test/java/org/elasticsoftware/akcestest/AccountConfiguration.java Switch to JsonMapperBuilderCustomizer and module-based serializer registration.
main/runtime/src/main/java/org/elasticsoftware/akces/kafka/KafkaAggregateRuntime.java Update serialization exception handling to Jackson 3 (JacksonException).
main/runtime/src/main/java/org/elasticsoftware/akces/kafka/AggregateRuntimeFactory.java Update ObjectMapper import to Jackson 3 namespace.
main/runtime/src/main/java/org/elasticsoftware/akces/beans/AggregateBeanFactoryPostProcessor.java Update ObjectMapper import to Jackson 3 namespace.
main/runtime/src/main/java/org/elasticsoftware/akces/AkcesAggregateController.java Update ObjectMapper import/type usage to Jackson 3 namespace.
main/runtime/src/main/java/org/elasticsoftware/akces/AggregateServiceApplication.java Replace Jackson2 customizer with JsonMapperBuilderCustomizer + modules.
main/runtime/pom.xml Switch to spring-boot-jackson and update protobuf dataformat dependency groupId.
main/query-support/src/test/java/org/elasticsoftware/akces/query/models/QueryModelRuntimeTests.java Remove try/catch around Jackson-only checked exceptions after migration.
main/query-support/src/test/java/org/elasticsoftware/akces/query/database/DatabaseModelRuntimeTests.java Remove try/catch around Jackson-only checked exceptions after migration.
main/query-support/src/test/java/org/elasticsoftware/akces/query/TestUtils.java Build mapper via JsonMapper + modules; drop obsolete checked exception signatures.
main/query-support/src/main/java/org/elasticsoftware/akces/query/models/beans/QueryModelBeanFactoryPostProcessor.java Update ObjectMapper import to Jackson 3 namespace.
main/query-support/src/main/java/org/elasticsoftware/akces/query/models/QueryModelRuntimeFactory.java Update ObjectMapper import to Jackson 3 namespace.
main/query-support/src/main/java/org/elasticsoftware/akces/query/models/KafkaQueryModelRuntime.java Update ObjectMapper import to Jackson 3 namespace.
main/query-support/src/main/java/org/elasticsoftware/akces/query/models/AkcesQueryModelController.java Update ObjectMapper/TypeReference imports to Jackson 3 namespace.
main/query-support/src/main/java/org/elasticsoftware/akces/query/models/AkcesQueryModelAutoConfiguration.java Switch to JsonMapperBuilderCustomizer and module-based serializer registration.
main/query-support/src/main/java/org/elasticsoftware/akces/query/database/beans/DatabaseModelBeanFactoryPostProcessor.java Update ObjectMapper import to Jackson 3 namespace.
main/query-support/src/main/java/org/elasticsoftware/akces/query/database/KafkaDatabaseModelRuntime.java Update ObjectMapper import to Jackson 3 namespace.
main/query-support/src/main/java/org/elasticsoftware/akces/query/database/DatabaseModelRuntimeFactory.java Update ObjectMapper import to Jackson 3 namespace.
main/query-support/src/main/java/org/elasticsoftware/akces/query/database/AkcesDatabaseModelController.java Update ObjectMapper import to Jackson 3 namespace.
main/query-support/src/main/java/org/elasticsoftware/akces/query/database/AkcesDatabaseModelAutoConfiguration.java Switch to JsonMapperBuilderCustomizer and module-based serializer registration.
main/query-support/pom.xml Switch to spring-boot-jackson.
main/pom.xml Update Jackson BOM groupId and Jackson version property.
main/eventcatalog/src/test/java/org/elasticsoftware/akces/eventcatalog/EventCatalogProcessorTest.java Build mapper via JsonMapper + modules for schema validation in tests.
main/eventcatalog/pom.xml Switch Jackson databind test dependency to tools.jackson.core.
main/client/src/test/java/org/elasticsoftware/akces/client/AkcesClientTests.java Replace Jackson2ObjectMapperBuilder usages with JsonMapper + modules; update exceptions.
main/client/src/main/java/org/elasticsoftware/akces/client/AkcesClientController.java Update serialization/deserialization exception handling to Jackson 3 (JacksonException).
main/client/src/main/java/org/elasticsoftware/akces/client/AkcesClientAutoConfiguration.java Switch to JsonMapperBuilderCustomizer and module-based serializer registration.
main/client/pom.xml Switch to spring-boot-jackson and update protobuf dataformat dependency groupId.


@Test
public void testSendCommand() throws InterruptedException, JsonProcessingException {
public void testSendCommand() throws InterruptedException, JacksonException {

@Test
public void testSendCommandWithCorrelationId() throws InterruptedException, JsonProcessingException {
public void testSendCommandWithCorrelationId() throws InterruptedException, JacksonException {

@Test
public void testGDPRDecryption() throws InterruptedException, JsonProcessingException {
public void testGDPRDecryption() throws InterruptedException, JacksonException {
* Converts a SchemaRecord to DTO (JsonSchema → String).
*/
static SchemaRecordDTO from(SchemaRecord record, ObjectMapper jsonMapper) throws JsonProcessingException {
static SchemaRecordDTO from(SchemaRecord record, ObjectMapper jsonMapper) throws JacksonException {
… and JsonSchemaTests

Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>
Copilot AI requested a review from jwijgerd March 17, 2026 16:53
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jwijgerd
jwijgerd merged commit e93cac6 into main Mar 26, 2026
7 checks passed
@jwijgerd
jwijgerd deleted the copilot/implement-phase-8-jackson-3-migration branch March 26, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants