{"record":{"id":"5e0d10cceb26f2e5","repo":"hibernate/hibernate-orm","slug":"illegal-attempt-to-locate-field-propertyname","errorCode":null,"errorMessage":"Illegal attempt to locate field [\" + propertyName + \"] on Object.class","messagePattern":"Illegal attempt to locate field \\[\" \\+ propertyName \\+ \"\\] on Object\\.class","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/internal/util/ReflectHelper.java","lineNumber":393,"sourceCode":"\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic static Method getMethod(Class<?> clazz, String methodName, Class<?>... paramTypes) {\n\t\ttry {\n\t\t\treturn clazz.getMethod( methodName, paramTypes );\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic static Field findField(Class<?> containerClass, String propertyName) {\n\t\tif ( containerClass == null ) {\n\t\t\tthrow new IllegalArgumentException( \"Class<?> on which to find field [\" + propertyName + \"] cannot be null\" );\n\t\t}\n\t\telse if ( containerClass == Object.class ) {\n\t\t\tthrow new IllegalArgumentException( \"Illegal attempt to locate field [\" + propertyName + \"] on Object.class\" );\n\t\t}\n\t\telse {\n\t\t\tfinal Field field = locateField( containerClass, propertyName );\n\t\t\tif ( field == null ) {\n\t\t\t\tthrow new PropertyNotFoundException(\n\t\t\t\t\t\tString.format(\n\t\t\t\t\t\t\t\tLocale.ROOT,\n\t\t\t\t\t\t\t\t\"Could not locate field name [%s] on class [%s]\",\n\t\t\t\t\t\t\t\tpropertyName,\n\t\t\t\t\t\t\t\tcontainerClass.getName()\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\tensureAccessibility( field );\n\t\t\treturn field;\n\t\t}\n\t}\n","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/internal/util/ReflectHelper.java#L375-L411","documentation":"Error \"Illegal attempt to locate field [\" + propertyName + \"] on Object.class\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown at hibernate-core/src/main/java/org/hibernate/internal/util/ReflectHelper.java:393 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not look up fields on Object.class; check the target class before recursing up the hierarchy."],"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"}