{"record":{"id":"cb771a5cbfa519c6","repo":"hibernate/hibernate-orm","slug":"produced-proxy-does-not-correctly-implement-hibern-cb771a","errorCode":null,"errorMessage":"Produced proxy does not correctly implement HibernateProxy","messagePattern":"Produced proxy does not correctly implement HibernateProxy","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyProxyHelper.java","lineNumber":124,"sourceCode":"\t\t\t\tresolveIdGetterMethod( proxy ),\n\t\t\t\tresolveIdSetterMethod( proxy ),\n\t\t\t\tproxy.getComponentIdType(),\n\t\t\t\tnull,\n\t\t\t\toverridesEquals( proxy.getPersistentClass() )\n\t\t);\n\n\t\t// note: interface is assumed to already contain HibernateProxy.class\n\t\ttry {\n\t\t\tfinal var proxyClass = buildProxy( proxy.getPersistentClass(), proxy.getInterfaces() );\n\t\t\tfinal var instance = (PrimeAmongSecondarySupertypes) proxyClass.getDeclaredConstructor().newInstance();\n\t\t\tfinal var proxyConfiguration = instance.asProxyConfiguration();\n\t\t\tif ( proxyConfiguration == null ) {\n\t\t\t\tthrow new HibernateException( \"Produced proxy does not correctly implement ProxyConfiguration\" );\n\t\t\t}\n\t\t\tproxyConfiguration.$$_hibernate_set_interceptor( interceptor );\n\t\t\tfinal var hibernateProxy = instance.asHibernateProxy();\n\t\t\tif ( hibernateProxy == null ) {\n\t\t\t\tthrow new HibernateException( \"Produced proxy does not correctly implement HibernateProxy\" );\n\t\t\t}\n\t\t\treturn hibernateProxy;\n\t\t}\n\t\tcatch (Throwable t) {\n\t\t\tthrow new HibernateException( \"Bytecode enhancement failed for entity '\"\n\t\t\t\t\t+ proxy.getEntityName() + \"'\", t );\n\t\t}\n\t}\n\n\tprivate static Method resolveIdGetterMethod(SerializableProxy serializableProxy) {\n\t\tif ( serializableProxy.getIdentifierGetterMethodName() == null ) {\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\treturn serializableProxy.getIdentifierGetterMethodClass()\n\t\t\t\t\t.getDeclaredMethod( serializableProxy.getIdentifierGetterMethodName() );\n\t\t}","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyProxyHelper.java#L106-L142","documentation":"Error \"Produced proxy does not correctly implement HibernateProxy\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A runtime precondition of the Hibernate API is violated.","commonSituations":"Occurs when application code or configuration does not satisfy the documented contract of the API being called.","solutions":["Ensure proxy generation is not intercepted by other agents or shade plugins.","Align Hibernate/ByteBuddy versions."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}