{"record":{"id":"5efdf93f6dd77b50","repo":"hibernate/hibernate-orm","slug":"incompatible-with","errorCode":null,"errorMessage":"{} incompatible with {}","messagePattern":"(.+?) incompatible with (.+?)","errorType":"exception","errorClass":"ClassCastException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyInterceptor.java","lineNumber":50,"sourceCode":"\t\t\tSharedSessionContractImplementor session,\n\t\t\tboolean overridesEquals) {\n\t\tsuper( entityName, persistentClass, id, getIdentifierMethod, setIdentifierMethod, componentIdType, session, overridesEquals );\n\t\tthis.interfaces = interfaces;\n\t}\n\n\t@Override\n\tpublic Object intercept(Object proxy, Method method, Object[] args) throws Throwable {\n\t\treturn invoke( method, args, proxy );\n\t}\n\n\t@Override\n\tprotected Object call(Object proxy, Method method, Object[] args) throws Throwable {\n\t\tfinal Object target = getImplementation();\n\t\tfinal Object returnValue;\n\t\ttry {\n\t\t\tif ( isPublic( persistentClass, method ) ) {\n\t\t\t\tif ( !method.getDeclaringClass().isInstance( target ) ) {\n\t\t\t\t\tthrow new ClassCastException(\n\t\t\t\t\t\t\ttarget.getClass().getName()\n\t\t\t\t\t\t\t+ \" incompatible with \"\n\t\t\t\t\t\t\t+ method.getDeclaringClass().getName()\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturnValue = method.invoke( target, args );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmethod.setAccessible( true );\n\t\t\t\treturnValue = method.invoke( target, args );\n\t\t\t}\n\n\t\t\tif ( returnValue == target ) {\n\t\t\t\tfinal var returnValueClass = returnValue.getClass();\n\t\t\t\tif ( returnValueClass.isInstance( proxy ) ) {\n\t\t\t\t\treturn proxy;\n\t\t\t\t}\n\t\t\t\telse {","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyInterceptor.java#L32-L68","documentation":"Error \"{} incompatible with {}\" 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 interceptor's entity class matches the proxy's persistent class.","Avoid mixing proxies created for different entity mappings."],"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"}