{"record":{"id":"c5ac2c8f934a07c1","repo":"hibernate/hibernate-orm","slug":"unable-to-resolve-field-on-deserialization-d","errorCode":null,"errorMessage":"Unable to resolve field on deserialization : \" + declaringClass.getName() + \"#\" + fieldName","messagePattern":"Unable to resolve field on deserialization : \" \\+ declaringClass\\.getName\\(\\) \\+ \"#\" \\+ fieldName","errorType":"exception","errorClass":"PropertyAccessSerializationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/property/access/internal/AbstractFieldSerialForm.java","lineNumber":38,"sourceCode":"\tprivate final String fieldName;\n\n\tprotected AbstractFieldSerialForm(Field field) {\n\t\tthis( field.getDeclaringClass(), field.getName() );\n\t}\n\n\tprotected AbstractFieldSerialForm(Class<?> declaringClass, String fieldName) {\n\t\tthis.declaringClass = declaringClass;\n\t\tthis.fieldName = fieldName;\n\t}\n\n\tprotected Field resolveField() {\n\t\ttry {\n\t\t\tfinal var field = declaringClass.getDeclaredField( fieldName );\n\t\t\tReflectHelper.ensureAccessibility( field );\n\t\t\treturn field;\n\t\t}\n\t\tcatch (NoSuchFieldException e) {\n\t\t\tthrow new PropertyAccessSerializationException(\n\t\t\t\t\t\"Unable to resolve field on deserialization : \" + declaringClass.getName() + \"#\" + fieldName\n\t\t\t);\n\t\t}\n\t}\n}\n","sourceCodeStart":20,"sourceCodeEnd":44,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/property/access/internal/AbstractFieldSerialForm.java#L20-L44","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try (ObjectInputStream in = new ObjectInputStream(bytes)) {\n    Object cached = in.readObject();\n} catch (org.hibernate.PropertyAccessSerializationException e) {\n    // entity class shape changed since serialization: drop the cached entry and rebuild\n}","preventionTips":["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"],"tags":["hibernate","serialization","reflection","property-access","deployment"],"backgroundTag":"deserialization-no-such-field","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}