{"record":{"id":"f433fb1703cefc91","repo":"quarkusio/quarkus","slug":"failed-to-call-method","errorCode":null,"errorMessage":"Failed to call method ","messagePattern":"Failed to call method ","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/extension/ConfigurationUtils.java","lineNumber":28,"sourceCode":"\n// This is necessary because in included builds the returned `Project` instance and\n// `QuarkusExtensionConfiguration` extension is provided by a different class loader\n// which prevents us from creating some interface or casting to it directly.\npublic class ConfigurationUtils {\n    private static Object callGetter(@NotNull Object extensionConfiguration, String getterName) {\n        final Method getterMethod;\n\n        try {\n            getterMethod = extensionConfiguration.getClass().getMethod(getterName);\n        } catch (NoSuchMethodException e) {\n            throw new GradleException(\n                    \"Didn't find method \" + getterName + \" on class \" + extensionConfiguration.getClass().getName(), e);\n        }\n\n        try {\n            return getterMethod.invoke(extensionConfiguration);\n        } catch (IllegalAccessException | InvocationTargetException e) {\n            throw new GradleException(\n                    \"Failed to call method \" + getterName + \" on class \" + extensionConfiguration.getClass().getName(), e);\n        }\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    public static Property<String> getDeploymentModule(@NotNull Object extensionConfiguration) {\n        return (Property<String>) callGetter(extensionConfiguration, \"getDeploymentModule\");\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    public static ListProperty<String> getConditionalDependencies(@NotNull Object extensionConfiguration) {\n        return (ListProperty<String>) callGetter(extensionConfiguration, \"getConditionalDependencies\");\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    public static ListProperty<String> getConditionalDevDependencies(@NotNull Object extensionConfiguration) {\n        return (ListProperty<String>) callGetter(extensionConfiguration, \"getConditionalDevDependencies\");\n    }","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/extension/ConfigurationUtils.java#L10-L46","documentation":"ConfigurationUtils.callGetter invokes the located getter reflectively on the Quarkus Gradle extension configuration. If invocation fails with IllegalAccessException or InvocationTargetException, it throws a GradleException naming the method and class. The underlying cause (the getter itself threw, or access was denied) is attached to the GradleException.","triggerScenarios":"getDeploymentModule, getConditionalDependencies, getConditionalDevDependencies, or getDependencyConditions successfully find the getter method, but invoking it on the extension configuration throws at runtime.","commonSituations":"Getter lazily computing a Property value that itself fails (e.g. invalid configuration values); Gradle restricting reflective access to decorated/internal classes; classpath mixing Quarkus plugin versions so the extension object's state is inconsistent.","solutions":["Read the caused-by exception in the GradleException stack trace to see what the getter actually threw","Fix the extension configuration value that the getter was trying to return (e.g. malformed conditional dependency declaration)","Ensure the same Quarkus Gradle plugin version is used consistently across all projects","Align Gradle and Quarkus plugin versions to a supported combination"],"exampleFix":"// before — conditional dependency with an invalid coordinate in build.gradle\nquarkus { conditionalDependencies { enabler(\"io.quarkus:does-not-exist\") } }\n// after\nquarkus { conditionalDependencies { enabler(\"io.quarkus:quarkus-rest-client\") } }","handlingStrategy":"try-catch","validationCode":"// smoke-test the getters before evaluation completes\ndef ext = project.extensions.findByName('quarkus')\ntry {\n    ext?.deploymentModule\n} catch (Throwable t) {\n    logger.warn(\"Quarkus extension getter failed early: {}\", t.message)\n}","typeGuard":null,"tryCatchPattern":"try {\n    project.evaluate()\n} catch (GradleException e) {\n    if (e.message?.startsWith('Failed to call method ')) {\n        logger.error(\"Getter threw: inspect caused-by for the real failure: {}\", e.cause?.cause ?: e.cause ?: e)\n    }\n    throw e\n}","preventionTips":["Always inspect the caused-by chain; the GradleException wraps the real getter failure","Keep extension configuration values valid (real coordinates, existing modules)","Use one consistent Quarkus plugin version across projects","Avoid unsupported Gradle versions where decorated extension access may be restricted"],"tags":["gradle","reflection","invocation-failure"],"backgroundTag":"reflective-method-invocation-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}