hibernate/hibernate-orm · error · HibernateException
Unable to deserialize proxy
Error message
Unable to deserialize proxy [%s, %s]; could not locate id getter method [%s] on entity class [%s]
What it means
Deserialization guard in resolveIdGetterMethod: the SerializableProxy records an identifier getter method name that no longer exists on the recorded entity class (getDeclaredMethod threw NoSuchMethodException). Typically caused by the entity class changing between serialization and deserialization; the faulty input is the recorded getter name/class pair.
Solutions
- Define an id getter matching the mapped identifier property on the entity class.
- Ensure serialization/deserialization uses the same entity mapping.
Defensive patterns
Strategy: validation
When it happens
Trigger: A name referenced in a mapping, query, or configuration cannot be resolved at runtime.
Common situations: Typos in entity/attribute/mapping names, missing mappings, or refactoring without updating references.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/623c4c7f2c3a81bc.
Report an issue: GitHub.
Appendix: source
Thrown at hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyProxyHelper.java:144
return hibernateProxy;
}
catch (Throwable t) {
throw new HibernateException( "Bytecode enhancement failed for entity '"
+ proxy.getEntityName() + "'", t );
}
}
private static Method resolveIdGetterMethod(SerializableProxy serializableProxy) {
if ( serializableProxy.getIdentifierGetterMethodName() == null ) {
return null;
}
try {
return serializableProxy.getIdentifierGetterMethodClass()
.getDeclaredMethod( serializableProxy.getIdentifierGetterMethodName() );
}
catch (NoSuchMethodException e) {
throw new HibernateException(
String.format(
Locale.ENGLISH,
"Unable to deserialize proxy [%s, %s]; could not locate id getter method [%s] on entity class [%s]",
serializableProxy.getEntityName(),
serializableProxy.getId(),
serializableProxy.getIdentifierGetterMethodName(),
serializableProxy.getIdentifierGetterMethodClass()
)
);
}
}
private static Method resolveIdSetterMethod(SerializableProxy serializableProxy) {
if ( serializableProxy.getIdentifierSetterMethodName() == null ) {
return null;
}
try {View on GitHub (pinned to fad1729dce)