{"record":{"id":"08cf1ba9a03f018d","repo":"apache/cassandra","slug":"unable-to-find-getter-for-property-s-on-class","errorCode":null,"errorMessage":"Unable to find getter for property '%s' on class %s","messagePattern":"Unable to find getter for property '(.+?)' on class (.+?)","errorType":"validation","errorClass":"org.apache.cassandra.config.YAMLException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DefaultLoader.java","lineNumber":112,"sourceCode":"        public MethodPropertyPlus(PropertyDescriptor property)\n        {\n            super(property);\n            this.readMethod = property.getReadMethod();\n        }\n\n        @Override\n        public Object get(Object object)\n        {\n            if (!isReadable())\n                throw new YAMLException(\"No readable property '\" + getName() + \"' on class: \" + object.getClass().getName());\n\n            try\n            {\n                return readMethod.invoke(object);\n            }\n            catch (IllegalAccessException e)\n            {\n                throw new YAMLException(\"Unable to find getter for property '\" + getName() + \"' on class \" + object.getClass().getName(), e);\n            }\n            catch (InvocationTargetException e)\n            {\n                throw new YAMLException(\"Failed calling getter for property '\" + getName() + \"' on class \" + object.getClass().getName(), e.getCause());\n            }\n        }\n    }\n}\n","sourceCodeStart":94,"sourceCodeEnd":121,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DefaultLoader.java#L94-L121","documentation":"The same property accessor throws YAMLException when invoking the read method fails with IllegalAccessException — i.e. the getter exists but is not accessible to the loader (non-public or restricted). The message wraps the original exception as the cause.","triggerScenarios":"Reading a cassandra.yaml-backed config property whose getter method is not public or is inaccessible under the active classloader/security manager during DefaultLoader property resolution.","commonSituations":"Custom or patched Config classes with package-private getters; module/JPMS restrictions hiding the getter; shaded/relocated classes breaking reflective access.","solutions":["Make the property's getter public on the config class.","Ensure the config class and its getters are in an open/exported package for reflective access.","Rebuild/redeploy the unmodified upstream Config class instead of a locally patched one."],"exampleFix":"// before\nObject getValue() { return value; }\n// after\npublic Object getValue() { return value; }","handlingStrategy":"try-catch","validationCode":"// check Modifier.isPublic(targetClass.getMethod(\"get\" + cap(prop)).getModifiers()) before loading","typeGuard":"null","tryCatchPattern":"try { loader.load(yamlStream); } catch (YAMLException e) { log.error(\"inaccessible getter while loading config\", e.getCause()); }","preventionTips":["Make all config class getters public.","Avoid shaded/relocated config classes that break reflection.","Open packages for reflective access if using JPMS.","Run config-loading tests against the exact deployed artifact."],"tags":["yaml","reflection","configuration"],"backgroundTag":"yaml-parse-error","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}