{"record":{"id":"a8cee5977894621c","repo":"hibernate/hibernate-orm","slug":"produced-proxy-does-not-correctly-implement-hibern","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/ByteBuddyProxyFactory.java","lineNumber":90,"sourceCode":"\t\t\t\tcomponentIdType,\n\t\t\t\tsession,\n\t\t\t\toverridesEquals\n\t\t);\n\n\t\tfinal var instance = getHibernateProxy();\n\t\tfinal var proxyConfiguration = instance.asProxyConfiguration();\n\t\tif ( proxyConfiguration == null ) {\n\t\t\tthrow new HibernateException( \"Produced proxy does not correctly implement ProxyConfiguration\" );\n\t\t}\n\t\tproxyConfiguration.$$_hibernate_set_interceptor( interceptor );\n\t\treturn instance;\n\t}\n\n\tprivate HibernateProxy getHibernateProxy() {\n\t\tfinal var internal = getHibernateProxyInternal();\n\t\tfinal var hibernateProxy = internal.asHibernateProxy();\n\t\tif ( hibernateProxy == null ) {\n\t\t\tthrow new HibernateException( \"Produced proxy does not correctly implement HibernateProxy\" );\n\t\t}\n\t\treturn hibernateProxy;\n\t}\n\n\t/**\n\t * This technically returns a HibernateProxy, but declaring that type as the return\n\t * type for the newInstance() action triggers an implicit case of type pollution.\n\t * We therefore declare it as PrimeAmongSecondarySupertypes, and require the\n\t * invoker to perform the narrowing\n\t */\n\tprivate PrimeAmongSecondarySupertypes getHibernateProxyInternal() throws HibernateException {\n\t\ttry {\n\t\t\treturn (PrimeAmongSecondarySupertypes) proxyClass.getConstructor().newInstance();\n\t\t}\n\t\tcatch (NoSuchMethodException e) {\n\t\t\tthrow new HibernateException(\n\t\t\t\t\t\"Bytecode enhancement failed because no public, protected or package-private default constructor was found for entity '\"\n\t\t\t\t\t\t\t+ entityName + \"' (private constructors don't work with runtime proxies)\", e );","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyProxyFactory.java#L72-L108","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 the proxy generation completed without interference from other bytecode tools.","Align Hibernate and 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"}