Encounter problems during upgrading from 3.4.2 to 4.0.3

I am upgrading my application from Axon Framework 3.4.2 to Axon 4.0.3. My SagaStore implementation is changed from

public SagaStore<Object> mongoSagaStore(MongoClient client) {
    return new MongoSagaStore(new DefaultMongoTemplate(client));


Hi Polly,

In Axon 4, TrackingEventProcessor is default, and a TEP needs to a token store to track which events it already processed.
By default Axon will register JPA entities for the Token store and other axon persisted stuff (I.e. saga associations, snapshots etc…).

The error you see, is that JPA/Hibernate can not locate the TokenEntry Entity. You might want to add this to your @Configuration class:

@EntityScan(basePackages = {

This will make sure, JPA will find the token entity and is able to map it to the DB.
I have a similar situation, where our @Bean configuration reside in a different dependency (i.e. maven/gradle module) then the Spring Boot Application
itself, so the @Entity are not picked up and need to be scanned.

HTH, let us know.