{"record":{"id":"a225dc4c722a9a00","repo":"flowable/flowable-engine","slug":"cannot-find-method-name-with-params-length-p","errorCode":null,"errorMessage":"Cannot find method ${name} with ${params.length} parameters in ${base.getClass()}","messagePattern":"Cannot find method (.+?) with (.+?) parameters in (.+?)","errorType":"exception","errorClass":"MethodNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/javax/el/BeanELResolver.java","lineNumber":210,"sourceCode":"\t\t\tthrow new ELException(e);\n\t\t}\n\t}\n\n\t@Override\n\tpublic Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params) {\n\t\tObjects.requireNonNull(context, \"context is null\");\n\t\tif (base == null || method == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tObject result = null;\n\t\tif (params == null) {\n\t\t\tparams = new Object[0];\n\t\t}\n\t\tString name = method.toString();\n\t\tMethod target = Util.findMethod(context, base.getClass(), base, name, paramTypes, params);\n\t\tif (target == null) {\n\t\t\tthrow new MethodNotFoundException(\"Cannot find method \" + name + \" with \" + params.length + \" parameters in \" + base.getClass());\n\t\t}\n\n\t\tObject[] parameters = Util.buildParameters(context, target.getParameterTypes(), target.isVarArgs(), params);\n\t\ttry {\n\t\t\tresult = invoke(target, base, parameters);\n\t\t} catch (InvocationTargetException e) {\n\t\t\tThrowable cause = e.getCause();\n\t\t\tUtil.handleThrowable(cause);\n\t\t\tthrow new ELException(cause);\n\t\t} catch (IllegalArgumentException | IllegalAccessException e) {\n\t\t\tthrow new ELException(e);\n\t\t}\n\t\tcontext.setPropertyResolved(base, method);\n\t\treturn result;\n\t}\n\n\tprotected Object invoke(Method target, Object base, Object... parameters) throws InvocationTargetException, IllegalAccessException {\n\t\treturn target.invoke(base, parameters);","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/javax/el/BeanELResolver.java#L192-L228","documentation":"BeanELResolver.invoke throws MethodNotFoundException when Util.findMethod cannot locate a method matching the requested name and parameter types on the base object's class. The message includes the method string and the number of supplied parameters.","triggerScenarios":"Calling ${bean.method(arg)} in EL where no method with that name/arity/parameter types exists — wrong method name, wrong number of arguments, argument types that cannot be coerced to a matching signature, or the method is not public.","commonSituations":"Typos in EL method calls; calling methods with primitives vs wrapper mismatches after refactoring; invoking methods removed in a library version upgrade; calling non-public methods from expressions.","solutions":["Verify the exact method name and that it is public on the base object's class.","Match the argument count and types to an existing overload (mind varargs and autoboxing).","Expose a public wrapper method on the bean if the intended target is inaccessible."],"exampleFix":"// before\n${order.calcTotal()} // method renamed\n// after\npublic BigDecimal calculateTotal() {...} -> ${order.calculateTotal()}","handlingStrategy":"validation","validationCode":"boolean exists = Arrays.stream(base.getClass().getMethods()).anyMatch(m -> m.getName().equals(name) && m.getParameterCount() == args.length);","typeGuard":null,"tryCatchPattern":"try { result = resolver.invoke(ctx, base, method, paramTypes, args); } catch (MethodNotFoundException e) { /* fix name/arity/types */ }","preventionTips":["Verify method name, arity, and argument types before adding EL method calls","Keep invoked methods public","Add smoke tests that evaluate all expression strings used in configs"],"tags":["el","bean","method-not-found","reflection","expression-language"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}