hibernate/hibernate-orm · error · PropertyAccessSerializationException
Unable to resolve field on deserialization : " + declaringCl
Error message
Unable to resolve field on deserialization : " + declaringClass.getName() + "#" + fieldName
What it means
Field-based property accessors serialize themselves as a compact serial form holding only (declaringClass, fieldName). On deserialization, AbstractFieldSerialForm.resolveField re-locates the Field reflectively; if the class version on the reading JVM no longer declares that field, NoSuchFieldException is wrapped in PropertyAccessSerializationException.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/property/access/internal/AbstractFieldSerialForm.java:38
private final String fieldName;
protected AbstractFieldSerialForm(Field field) {
this( field.getDeclaringClass(), field.getName() );
}
protected AbstractFieldSerialForm(Class<?> declaringClass, String fieldName) {
this.declaringClass = declaringClass;
this.fieldName = fieldName;
}
protected Field resolveField() {
try {
final var field = declaringClass.getDeclaredField( fieldName );
ReflectHelper.ensureAccessibility( field );
return field;
}
catch (NoSuchFieldException e) {
throw new PropertyAccessSerializationException(
"Unable to resolve field on deserialization : " + declaringClass.getName() + "#" + fieldName
);
}
}
}
View on GitHub (pinned to fad1729dce)
Solutions
- Clear or expire serialized caches whenever entity classes change
- Deploy identical entity classes (and the same Hibernate version) on every node that shares serialized state
- Avoid renaming or removing mapped fields in a single step; do it across releases with cache invalidation in between
- If hit during an upgrade, flush the affected cache/store so entries are rebuilt with the current class shape
Defensive patterns
Strategy: try-catch
Try / catch
try (ObjectInputStream in = new ObjectInputStream(bytes)) {
Object cached = in.readObject();
} catch (org.hibernate.PropertyAccessSerializationException e) {
// entity class shape changed since serialization: drop the cached entry and rebuild
} Prevention
- Version or invalidate serialized caches on every entity class change
- Deploy identical entity classes and Hibernate versions across nodes sharing serialized state
- Key cache entries by a hash of the entity class shape so mismatches miss instead of crashing
- Purge persistent caches as part of the deployment runbook
When it happens
Trigger: Deserializing a cached or clustered artifact that embeds a serialized PropertyAccess (for example a serialized query plan or domain payload carried across nodes) after the entity class was recompiled with that field renamed or removed.
Common situations: Rolling deployments where nodes run different entity class versions; persistent serialization caches that survive refactors; a cluster mixing Hibernate versions that serialize accessors with different shapes; field renamed or dropped between releases.
Related errors
- Unable to resolve setter method on deserialization : " + dec
- Could not locate getter method for property '%s' of class '%
- Could not locate setter method for property '%s' of class '%
- Could not locate field for property named [" + containerJava
- Could not locate getter for property named [" + containerJav
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/c5ac2c8f934a07c1.
Report an issue: GitHub.