Spring boot 4 with AF 4.12

when switching to spring boot 4 on AF 4.12 I get this error when starting application

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serializer' defined in class path resource [org/axonframework/springboot/autoconfig/AxonAutoConfiguration.class]: Failed to instantiate [org.axonframework.serialization.Serializer]: Factory method 'serializer' threw exception with message: com/fasterxml/jackson/datatype/jsr310/JavaTimeModule
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:657)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:645)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1362)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1194)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:565)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:525)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:333)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:371)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:331)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:201)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:229)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1762)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1651)
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:912)
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
	... 137 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.axonframework.serialization.Serializer]: Factory method 'serializer' threw exception with message: com/fasterxml/jackson/datatype/jsr310/JavaTimeModule
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.lambda$instantiate$0(SimpleInstantiationStrategy.java:183)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiateWithFactoryMethod(SimpleInstantiationStrategy.java:72)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:152)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
	... 151 common frames omitted
Caused by: java.lang.NoClassDefFoundError: com/fasterxml/jackson/datatype/jsr310/JavaTimeModule
	at org.axonframework.springboot.autoconfig.AxonAutoConfiguration.buildSerializer(AxonAutoConfiguration.java:231)
	at org.axonframework.springboot.autoconfig.AxonAutoConfiguration.serializer(AxonAutoConfiguration.java:156)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.lambda$instantiate$0(SimpleInstantiationStrategy.java:155)
	... 154 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)
	... 159 common frames omitted

I assume that AF is not ready yet to work with spring boot 4 and we need to wait?

I would hope we can keep Axon Framework 4 compatible with Spring Boot 4, @rsobies. If anything, I think we have too. AF4 will still receive patches as long as we do not have full feature parity between AF4 and AF5 (somewhere next year).

To be frank, the stack trace you shared does not immediately raise Axon-concern-alarms for me, given that it’s complaining about Jackson. Are you sure it’s not a version mismatch between something Spring pulls in and something Jackson pulls in?

If you are certain, feel free to file a bug for AF, so that the team can look into it.

I have reported a bug Add support for spring boot 4 in AF 4.12 · Issue #4029 · AxonFramework/AxonFramework · GitHub

I would try adding the missing jackson-datatype dependency:.

<dependency>
    <groupId>com.fasterxml.jackson.datatype</groupId>
    <artifactId>jackson-datatype-jsr310</artifactId>
    <!-- version -->
</dependency>

Probably with the modularization in Spring Boot 4 the dependency has been moved. If in doubt, temporary add “-classic” to all your starters to verify if it works and then search the new starter that now contains jackson. (I assume it will be spring-boot-starter-jackson)

you are right.
There are also more dependencies required, for anybody information: https://github.com/AxonFramework/AxonFramework/issues/4029