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?