Runtime errors after upgrade from axon-3 to axon-4

Hi there,

I am trying to update my spring boot application from Axon 3 to 4.
Compiling works, but I get runtime errors.

I excluded axon server, my application should run without it.

At runtime (“mvn package” does some integration tests) I get this exception:

Caused by: java.lang.IllegalStateException: Default configuration requires the use of event sourcing. Either configure an Event Store to use, or configure a specific repository implementation for class org.oregami.gamingEnvironments.model.GamingEnvironment

Yes, I want to use event sourcing.
Yes, I have configured an EventStore in my “AxonConfig”.

It would be great if someone could help me out. There are not that many axon4 applications out there where I could get help.

My code is here:

(be sure to check out the branch “axon-4”).


Hi Sebastian,

I managed to reproduce it. Removing the @Import({AxonAutoConfiguration.class}) resolved the issue. Note that importing autoconfiguration classes is generally not a good idea, as they are treated slightly differently by Spring.

Note that you can also remove the dependency on axon-messaging. It is transitively available from the axon-spring-boot-starter, and therefore redundant.


Thank you very much for taking your time and helping me out of this!

At the moment I am on holiday but I will give it a try as soon as possible.

I have successfully adjusted the code, the error message does not appear anymore. Thanks a lot!

I have another problem now (Spring SecurityContext is not available, because Axon 4 now executes Commands in another thread as I have learned), but I will create a new question for that one.