{"record":{"id":"5a9d2b7168950bed","repo":"hibernate/hibernate-orm","slug":"unable-to-instantiate-proxy-instance","errorCode":null,"errorMessage":"Unable to instantiate proxy instance","messagePattern":"Unable to instantiate proxy instance","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/bytecode/internal/bytebuddy/BasicProxyFactoryImpl.java","lineNumber":83,"sourceCode":"\tpublic Object getProxy() {\n\t\tfinal var instance = instantiateProxy();\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\t// Create a dedicated interceptor for the proxy.\n\t\t// This is required as the interceptor is stateful.\n\t\tproxyConfiguration.$$_hibernate_set_interceptor(\n\t\t\t\tnew PassThroughInterceptor( proxyClass.getName() ) );\n\t\treturn instance;\n\t}\n\n\tprivate PrimeAmongSecondarySupertypes instantiateProxy() {\n\t\ttry {\n\t\t\treturn (PrimeAmongSecondarySupertypes) proxyClassConstructor.newInstance();\n\t\t}\n\t\tcatch (Throwable t) {\n\t\t\tthrow new HibernateException( \"Unable to instantiate proxy instance\", t );\n\t\t}\n\t}\n\n\tpublic boolean isInstance(Object object) {\n\t\treturn proxyClass.isInstance( object );\n\t}\n\n}\n","sourceCodeStart":65,"sourceCodeEnd":92,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/bytecode/internal/bytebuddy/BasicProxyFactoryImpl.java#L65-L92","documentation":"Error \"Unable to instantiate proxy instance\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Bytecode enhancement, proxy creation, or lazy interception is applied to an incompatible class or configuration.","commonSituations":"Build-time enhancement with module-system restrictions, mismatched Hibernate versions between build and runtime, or hibernate.bytecode.provider=none with a model that needs proxies.","solutions":["Ensure the proxied class has an accessible no-arg constructor and the ByteBuddy proxy can be defined (module opens/exports)."],"exampleFix":"Ensure the proxied class has an accessible no-arg constructor and the ByteBuddy proxy can be defined (module opens/exports).","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"}