{"record":{"id":"0f3a8efdb3714eb0","repo":"hibernate/hibernate-orm","slug":"cannot-find-an-accessor-s-on-type-s","errorCode":null,"errorMessage":"cannot find an accessor [%s] on type [%s]","messagePattern":"cannot find an accessor \\[(.+?)\\] on type \\[(.+?)\\]","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/bytecode/internal/bytebuddy/BytecodeProviderImpl.java","lineNumber":399,"sourceCode":"\t\tif ( setterNames.length != length || getterNames.length != length ) {\n\t\t\tthrow new HibernateException( \"bad number of accessors\" );\n\t\t}\n\n\t\tfinal Class<?>[] getParam = new Class[0];\n\t\tfor ( int i = 0; i < length; i++ ) {\n\t\t\tif ( getterNames[i] != null ) {\n\t\t\t\tfinal Method getter = findAccessor( clazz, getterNames[i], getParam );\n\t\t\t\tif ( getter.getReturnType() != types[i] ) {\n\t\t\t\t\tthrow new HibernateException( \"wrong return type: \" + getterNames[i] );\n\t\t\t\t}\n\n\t\t\t\tgetters[i] = getter;\n\t\t\t}\n\n\t\t\tif ( setterNames[i] != null ) {\n\t\t\t\tsetters[i] = ReflectHelper.setterMethodOrNullBySetterName( clazz, setterNames[i], types[i] );\n\t\t\t\tif ( setters[i] == null ) {\n\t\t\t\t\tthrow new HibernateException(\n\t\t\t\t\t\t\tString.format(\n\t\t\t\t\t\t\t\t\t\"cannot find an accessor [%s] on type [%s]\",\n\t\t\t\t\t\t\t\t\tsetterNames[i],\n\t\t\t\t\t\t\t\t\tclazz.getName()\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse if ( isPrivate( setters[i].getModifiers() ) ) {\n\t\t\t\t\tthrow new PrivateAccessorException( \"private accessor [\" + setterNames[i] + \"]\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static void findAccessors(\n\t\t\tClass<?> clazz,\n\t\t\tMap<String, PropertyAccess> propertyAccessMap,\n\t\t\tMember[] getters,","sourceCodeStart":381,"sourceCodeEnd":417,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/bytecode/internal/bytebuddy/BytecodeProviderImpl.java#L381-L417","documentation":"Error \"cannot find an accessor [%s] on type [%s]\" 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 every persistent property has a matching getter/setter pair with consistent types; check for misnamed accessors after refactoring."],"exampleFix":"Ensure every persistent property has a matching getter/setter pair with consistent types; check for misnamed accessors after refactoring.","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"}