{"record":{"id":"a5c5086ff2ae5876","repo":"flowable/flowable-engine","slug":"error-getting-method","errorCode":null,"errorMessage":"Error getting method ","messagePattern":"Error getting method ","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/el/AbstractFlowableFunctionDelegate.java","lineNumber":38,"sourceCode":"\n/**\n * Abstract class that can be used as a base class for pluggable functions that can be used in the EL expressions\n * \n * @author Tijs Rademakers\n */\npublic abstract class AbstractFlowableFunctionDelegate implements FlowableFunctionDelegate {\n    \n    /**\n     * The class, typically containing static methods. \n     * If {@link #functionMethod()} is provided, this method does not need to return a value.\n     */\n    public abstract Class<?> functionClass();\n\n    protected Method getNoParameterMethod() {\n        try {\n            return functionClass().getDeclaredMethod(localName());\n        } catch (Exception e) {\n            throw new FlowableException(\"Error getting method \" + localName(), e);\n        }\n    }\n    \n    protected Method getNoParameterMethod(String methodName) {\n        try {\n            return functionClass().getDeclaredMethod(methodName);\n        } catch (Exception e) {\n            throw new FlowableException(\"Error getting method \" + methodName, e);\n        }\n    }\n\n    protected Method getSingleObjectParameterMethod() {\n        try {\n            return functionClass().getDeclaredMethod(localName(), Object.class);\n        } catch (Exception e) {\n            throw new FlowableException(\"Error getting method \" + localName(), e);\n        }\n    }","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/el/AbstractFlowableFunctionDelegate.java#L20-L56","documentation":"AbstractFlowableFunctionDelegate.getNoParameterMethod() reflectively looks up a declared no-arg method named after localName() on functionClass(). If lookup fails (missing method, wrong name, class loading issues) it wraps the cause in a FlowableException 'Error getting method <localName>'.","triggerScenarios":"A FlowableFunctionDelegate subclass overrides functionClass()/localName() inconsistently so functionClass() has no declared no-arg method matching localName(); initialization of the function delegate at flowable-function registration time.","commonSituations":"Custom EL function delegates where localName does not match the Java method name; renaming the method in functionClass without updating the delegate; the function class not being on the classpath version expected.","solutions":["Ensure functionClass() declares a public method whose name exactly equals localName() with no parameters.","Use the explicit-name overload getNoParameterMethod(String) if the Java method name differs from the EL local name.","Check the functionClass is from the versioned dependency you expect (mvn dependency:tree) and that method visibility is public."],"exampleFix":"// before\nprotected Class<?> functionClass() { return StringUtils.class; }\nprotected String localName() { return \"toUpperCase\"; } // no such no-arg method\n// after\nprotected String localName() { return \"upperCase\"; } // matches StringUtils.upperCase()\n// or: getNoParameterMethod(\"upperCase\");","handlingStrategy":"validation","validationCode":"try { functionClass().getDeclaredMethod(localName()); } catch (NoSuchMethodException e) { throw new IllegalStateException(\"Delegate misconfigured: no method \" + localName() + \" on \" + functionClass()); }","typeGuard":null,"tryCatchPattern":"try { new MyFunctionDelegate(); } catch (FlowableException e) { log.error(\"Function delegate init failed: {}\", e.getMessage(), e.getCause()); }","preventionTips":["Keep localName() and the Java method name identical unless using explicit-name overloads","Add a unit test that constructs every custom function delegate","Verify functionClass() points at the dependency version you ship"],"tags":["flowable","reflection","el-functions"],"backgroundTag":"method-not-implemented","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}