From 028bd5e58916869ddad6ded4390d04cbd5c229d9 Mon Sep 17 00:00:00 2001 From: Alex Wieland <25109632+alex-w0@users.noreply.github.com> Date: Thu, 2 Apr 2026 08:48:24 +0200 Subject: [PATCH] swap jackson encoding strategy order --- .../AxoniqPlatformConfigurerEnhancer.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/framework-client-messaging/src/main/java/io/axoniq/platform/framework/AxoniqPlatformConfigurerEnhancer.java b/framework-client-messaging/src/main/java/io/axoniq/platform/framework/AxoniqPlatformConfigurerEnhancer.java index a0c1700..e03d59d 100644 --- a/framework-client-messaging/src/main/java/io/axoniq/platform/framework/AxoniqPlatformConfigurerEnhancer.java +++ b/framework-client-messaging/src/main/java/io/axoniq/platform/framework/AxoniqPlatformConfigurerEnhancer.java @@ -223,45 +223,45 @@ public void enhance(ComponentRegistry registry) { } /** - * Checks the classpath for Jackson 2 or Jackson 3 and its requiremenets for this application. + * Checks the classpath for Jackson 2 or Jackson 3 and its requirements for this application. * Will fail to create the component if neither is there, or if one is present and doesn't have the right modules. */ private static RSocketPayloadEncodingStrategy createJackson2Or3EncodingStrategy() { try { - Class.forName("tools.jackson.databind.ObjectMapper"); + Class.forName("com.fasterxml.jackson.databind.ObjectMapper"); try { - Class.forName("tools.jackson.dataformat.cbor.CBORMapper"); + Class.forName( + "com.fasterxml.jackson.dataformat.cbor.databind.CBORMapper"); try { - Class.forName("tools.jackson.module.kotlin.KotlinModule"); - return new CborJackson3EncodingStrategy(); + Class.forName( + "com.fasterxml.jackson.module.kotlin.KotlinModule"); + return new CborJackson2EncodingStrategy(); } catch (ClassNotFoundException e) { throw new IllegalArgumentException( - "Found Jackson 3 on the classpath, but can not find the KotlinModule. Please add the tools.jackson.module:jackson-module-kotlin dependency to your project"); + "Found Jackson 2 on the classpath, but can not find the KotlinModule. Please add the com.fasterxml.jackson.module:jackson-module-kotlin dependency to your project"); } } catch (ClassNotFoundException e) { throw new IllegalArgumentException( - "Found Jackson 3 on the classpath, but cannot find the CBOR dataformat. Please add the tools.jackson.dataformat:jackson-dataformat-cbor dependency to your project."); + "Found Jackson 2 on the classpath, but cannot find the CBOR dataformat. Please add the com.fasterxml.jackson.dataformat:jackson-dataformat-cbor dependency to your project."); } } catch (ClassNotFoundException e) { - // Do nothing, Jackson 3 is not on the classpath. Continue to check for 2 + // Do nothing, Jackson 2 is not on the classpath. Continue to check for 3 } try { - Class.forName("com.fasterxml.jackson.databind.ObjectMapper"); + Class.forName("tools.jackson.databind.ObjectMapper"); try { - Class.forName( - "com.fasterxml.jackson.dataformat.cbor.databind.CBORMapper"); + Class.forName("tools.jackson.dataformat.cbor.CBORMapper"); try { - Class.forName( - "com.fasterxml.jackson.module.kotlin.KotlinModule"); - return new CborJackson2EncodingStrategy(); + Class.forName("tools.jackson.module.kotlin.KotlinModule"); + return new CborJackson3EncodingStrategy(); } catch (ClassNotFoundException e) { throw new IllegalArgumentException( - "Found Jackson 2 on the classpath, but can not find the KotlinModule. Please add the com.fasterxml.jackson.module:jackson-module-kotlin dependency to your project"); + "Found Jackson 3 on the classpath, but can not find the KotlinModule. Please add the tools.jackson.module:jackson-module-kotlin dependency to your project"); } } catch (ClassNotFoundException e) { throw new IllegalArgumentException( - "Found Jackson 2 on the classpath, but cannot find the CBOR dataformat. Please add the com.fasterxml.jackson.dataformat:jackson-dataformat-cbor dependency to your project."); + "Found Jackson 3 on the classpath, but cannot find the CBOR dataformat. Please add the tools.jackson.dataformat:jackson-dataformat-cbor dependency to your project."); } } catch (ClassNotFoundException e) { throw new IllegalArgumentException(