[axonframework] Used entityManager in command dispatch interceptors

Hi Aymen,

If you are relying on the JpaAutoConfiguration to create the ContainerManagedEntityManagerProvider, it would be better to expect a bean of type EntityManagerProvider instead.
Stating this as the JpaAutoConfiguration does the following:

@Bean
@ConditionalOnMissingBean
public EntityManagerProvider entityManagerProvider() {
return new ContainerManagedEntityManagerProvider();
}

So, it returns an EntityManagerProvider, not a ContainerManagedEntityManagerProvider.
Could be wrong with my assumption here, but I am relatively confident Spring will see the former here as the thing to wire instead of the latter.

If this does not resolve your problem, then you are dealing with a spring ordering issue.
Might help to also add the JpaAutoConfiguration to you @AutoConfigureAfter annotation in that case.

Hoping this helps you further Aymen!

Cheers,
Steven

PS. It is important to note that this mailing list will be discontinued as specified in this thread.
Instead of this mailing list we have moved to use a forum style of communication, at https://discuss-next.axoniq.io/.

Hope to see you there!