{"record":{"id":"f67bfd7cd9470a40","repo":"hibernate/hibernate-orm","slug":"unable-to-deserialize-proxy-s-s-could-not-lo-f67bfd","errorCode":null,"errorMessage":"Unable to deserialize proxy [%s, %s]; could not locate id setter method [%s] on entity class [%s]","messagePattern":"Unable to deserialize proxy \\[(.+?), (.+?)\\]; could not locate id setter method \\[(.+?)\\] on entity class \\[(.+?)\\]","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyProxyHelper.java","lineNumber":168,"sourceCode":"\t\t\t\t\t\t\tserializableProxy.getIdentifierGetterMethodName(),\n\t\t\t\t\t\t\tserializableProxy.getIdentifierGetterMethodClass()\n\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate static Method resolveIdSetterMethod(SerializableProxy serializableProxy) {\n\t\tif ( serializableProxy.getIdentifierSetterMethodName() == null ) {\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\treturn serializableProxy.getIdentifierSetterMethodClass()\n\t\t\t\t\t.getDeclaredMethod( serializableProxy.getIdentifierSetterMethodName(),\n\t\t\t\t\t\t\tserializableProxy.getIdentifierSetterMethodParams() );\n\t\t}\n\t\tcatch (NoSuchMethodException e) {\n\t\t\tthrow new HibernateException(\n\t\t\t\t\tString.format(\n\t\t\t\t\t\t\tLocale.ENGLISH,\n\t\t\t\t\t\t\t\"Unable to deserialize proxy [%s, %s]; could not locate id setter method [%s] on entity class [%s]\",\n\t\t\t\t\t\t\tserializableProxy.getEntityName(),\n\t\t\t\t\t\t\tserializableProxy.getId(),\n\t\t\t\t\t\t\tserializableProxy.getIdentifierSetterMethodName(),\n\t\t\t\t\t\t\tserializableProxy.getIdentifierSetterMethodClass()\n\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n}\n","sourceCodeStart":150,"sourceCodeEnd":181,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyProxyHelper.java#L150-L181","documentation":"Deserialization guard in resolveIdSetterMethod: the identifier setter method recorded in the SerializableProxy cannot be found on the entity class via getDeclaredMethod (NoSuchMethodException), so the proxy's id cannot be restored. Usually the entity class changed after serialization; the faulty input is the recorded setter signature.","triggerScenarios":"A name referenced in a mapping, query, or configuration cannot be resolved at runtime.","commonSituations":"Typos in entity/attribute/mapping names, missing mappings, or refactoring without updating references.","solutions":["Define an id setter matching the mapped identifier property on the entity class.","Check that the identifier property access type is consistent."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}