{"record":{"id":"3e5973df457304f4","repo":"hibernate/hibernate-orm","slug":"attribute-method-is-not-accessible","errorCode":null,"errorMessage":"Attribute (method) {} is not accessible","messagePattern":"Attribute \\(method\\) (.+?) is not accessible","errorType":"exception","errorClass":"AttributeExtractionException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/jpa/internal/util/PersistenceUtilHelper.java","lineNumber":287,"sourceCode":"\t\tprivate final String name;\n\t\tprivate final Method method;\n\n\t\tpublic MethodAttributeAccess(String attributeName, Method method) {\n\t\t\tthis.name = attributeName;\n\t\t\ttry {\n\t\t\t\tReflectHelper.ensureAccessibility( method );\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tthis.method = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.method = method;\n\t\t}\n\n\t\t@Override\n\t\tpublic Object extractValue(Object owner) {\n\t\t\tif ( method == null ) {\n\t\t\t\tthrow new AttributeExtractionException( \"Attribute (method) \" + name + \" is not accessible\" );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\treturn method.invoke( owner );\n\t\t\t}\n\t\t\tcatch ( IllegalAccessException e ) {\n\t\t\t\tthrow new AttributeExtractionException(\n\t\t\t\t\t\t\"Unable to access attribute (method): \" + method.getDeclaringClass().getName() + \"#\" + name,\n\t\t\t\t\t\te\n\t\t\t\t);\n\t\t\t}\n\t\t\tcatch ( InvocationTargetException e ) {\n\t\t\t\tthrow new AttributeExtractionException(\n\t\t\t\t\t\t\"Unable to access attribute (method): \" + method.getDeclaringClass().getName() + \"#\" + name,\n\t\t\t\t\t\te.getCause()\n\t\t\t\t);\n\t\t\t}\n\t\t}","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/jpa/internal/util/PersistenceUtilHelper.java#L269-L305","documentation":"Error \"Attribute (method) {} is not accessible\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown at hibernate-core/src/main/java/org/hibernate/jpa/internal/util/PersistenceUtilHelper.java:287 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make the accessor method public/accessible or switch to field access for that attribute."],"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"}