Skip to content

framework-client-spring-boot-starter:2.0.0 throws ClassNotFoundException: SpringLazyCreatingModule with Axon Framework 5.0.2 #112

@petrmac

Description

@petrmac

The AxonIQ Platform client framework-client-spring-boot-starter:2.0.0 fails at runtime when used with Axon Framework 5.0.2. The client attempts to use org.axonframework.extension.spring.config.SpringLazyCreatingModule which does not exist in the Axon Spring extension 5.0.2.

Environment

  • Axon Framework: 5.0.2
  • Axon Spring Boot Starter: org.axonframework.extensions.spring:axon-spring-boot-starter:5.0.2
  • Platform Client: io.axoniq.platform:framework-client-spring-boot-starter:2.0.0
  • Java: 21
  • Spring Boot: 4.0.0

Steps to Reproduce

  1. Add the platform client dependency:

    implementation("io.axoniq.platform:framework-client-spring-boot-starter:2.0.0")
  2. Configure application.yml:

    axoniq:
      platform:
        credentials: "your-credentials"
        application-name: "MyApp"
  3. Run the application or execute tests that use AxonTestFixture

Error

java.lang.NoClassDefFoundError: org/axonframework/extension/spring/config/SpringLazyCreatingModule
    at io.axoniq.console.framework.starter.AxoniqPlatformLazyConfigurationEnhancer.doOnLazySubmodules(AxoniqPlatformLazyConfigurationEnhancer.kt:64)
    at io.axoniq.console.framework.starter.AxoniqPlatformLazyConfigurationEnhancer.enhance(AxoniqPlatformLazyConfigurationEnhancer.kt:36)
    at org.axonframework.common.configuration.DefaultComponentRegistry.invokeEnhancers(DefaultComponentRegistry.java:256)
    at org.axonframework.common.configuration.DefaultComponentRegistry.doBuild(DefaultComponentRegistry.java:196)
    at org.axonframework.common.configuration.DefaultComponentRegistry.build(DefaultComponentRegistry.java:167)

Caused by: java.lang.ClassNotFoundException: org.axonframework.extension.spring.config.SpringLazyCreatingModule
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)

Analysis

Looking at the platform-framework-client pom.xml, the client was built against Axon Framework 5.0.0 (<axon.version>5.0.0</axon.version>).

It appears that between Axon Framework 5.0.0 and 5.0.2, the class SpringLazyCreatingModule was either renamed, moved to a different package, or removed entirely.

The AxoniqPlatformLazyConfigurationEnhancer in the platform client references this class but it no longer exists in the Axon Spring extension 5.0.2.

Expected Behavior

The platform client should work with Axon Framework 5.0.x patch releases without breaking changes.

Workaround

Currently disabled the platform client integration until a compatible version is released.

Suggested Fix

Please update the platform-framework-client to be compatible with Axon Framework 5.0.2+ by:

  1. Updating the axon.version in pom.xml to 5.0.2
  2. Fixing the reference to SpringLazyCreatingModule to use whatever replaced it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions