AF4 SnapshotEventEntry fails to map on Spring Boot 4 / Hibernate 7

We got a complex AF4 service which is not easily upgraded to AF5. When upgrading to SB4 we encountered this issue:

Versions: Axon Framework 4.13.2 (BOM 4.13.3), Spring Boot 4.1.0
Startup fails building entityManagerFactory:
Caused by: org.hibernate.AnnotationException: Class
‘org.axonframework.eventsourcing.eventstore.AbstractSnapshotEventEntry$PK’ is the
@IdClass’ for the entity
‘org.axonframework.eventsourcing.eventstore.jpa.SnapshotEventEntry’
but has no persistent properties
We use a JdbcEventStorageEngine with a custom EventSchema, AbstractSnapshotEventEntry fails with exception mentioned above.
As far as we can tell: AbstractSnapshotEventEntry puts @IdClass and its @Id fields on a @MappedSuperclass. Hibernate 6 resolved that leniently; Hibernate 7’s stricter binder doesn’t, and concludes the IdClass has no persistent properties.

We have an explicit @EntityScan (in a shared internal starter) that registers our own entities, I’ve tried adding the axon-specific packages (which did not work) — per the Spring Boot integration docs, that’s only needed “when using a relational database as the Event Store,” which isn’t our case.
Tried so far:

  • Excluding JpaEventStoreAutoConfiguration via spring.autoconfigure.exclude — no effect.

  • A ManagedClassNameFilter bean to drop the package — no effect either.

  • Downgrading to Hibernate 6 — fails separately, since Boot 4 is build against Hibernate 7 and also not preferable since it would mean we’re stuck at 6

Does anyone have this same problem while upgrading to Springboot 4? Or is this a known issue with an easy fix we’ve missed?

Hi @Yvonne_Haagsma, hope you’re doing great! :waving_hand:

I can tell you that we have not seen this specific exception before.
Instead of focusing on the specific issue, I have another marker that’s good to know.
Axon Framework 5 does not have a JdbcEventStorageEngine at the moment.

We have opted against JDBC for the time being to merit construction of database-type specific engines, like the PostgresqlEventStorageEngine that’s included in Axoniq Framework. Thus, if a RDBMS is the choice for this project, you’re left with the AggregateBasedJpaEventStorageEngine in Axon Framework 5, or switch to the PostgresqlEventStorageEngine.

Now, I see this as valuable input, as your application right now isn’t starting due to the combination of AF4, SB4, and the use of the JdbcEventStorageEngine. Perhaps it’s worth your effort to first switch to the JpaEventStorageEngine, to set yourself up to do the AF4-to-AF5 migrration. Otherwise, your migration would be blocked anyhow due to the choice of engine.

So, hope that’s workable for the team you’re at right now. If you have any follow-up questions, you know where to reach us!

Hi Steven,

Thank you for the clear answer. We will discuss how to approach the issue from here. I’ll keep you posted and I will probably see you on the conference!

All the best!