Use spring boot 2.7.3 with axon-framework 4.9?

i used spring boot 2.7.3 and axon-framework 4.5, for some reason i tried to upgrade axon to 4.9
but after doing this application doesn’t start anymore.it seems that axon use spring 3 in infrastructure didn’t it?
is it compatible spring boot 2.7.3 and axon-framework?

any way i’m using JpaTokenStore in this code:

   @Bean
    public TokenStore myTokenStore(Serializer serializer) {
        return JpaTokenStore.builder()
                .entityManagerProvider(primaryEntityManagerProvider())
                .serializer(serializer)
               .loadingLockMode(LockModeType.NONE)
                .build();
    } 

and the error is:

java.lang.NoClassDefFoundError: jakarta/persistence/EntityManager

thanks axon community :))

Hi Hamed, since 4.7 we support both Spring Boot 2, and 3. But we default to Spring Boot 3 behavior. You should be able to use 4.9 with Spring Boot 2 as well. Actually most of our tests for Spring use Spring Boot 2. I hope the three steps here are helpful. If not, please let us know the problems you run into. The specific error you shared should be resolved by changing the JpaTokenStore to the legacy version using Javax.

1 Like

Thanks @Gerard
it helped :ok_hand: