{"record":{"id":"124a44f76f6e0061","repo":"flowable/flowable-engine","slug":"error-method-invalid","errorCode":"error.method.invalid","errorMessage":"error.method.invalid","messagePattern":"error\\.method\\.invalid","errorType":"exception","errorClass":"ELException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/de/odysseus/el/TreeMethodExpression.java","lineNumber":92,"sourceCode":"\t\tsuper();\n\n\t\tTree tree = store.get(expr);\n\n\t\tthis.builder = store.getBuilder();\n\t\tthis.bindings = tree.bind(functions, variables, converter);\n\t\tthis.expr = expr;\n\t\tthis.type = returnType;\n\t\tthis.types = paramTypes;\n\t\tthis.node = tree.getRoot();\n\t\tthis.deferred = tree.isDeferred();\n\n\t\tif (node.isLiteralText()) {\n\t\t\tif (returnType == void.class || returnType == Void.class) {\n\t\t\t\tthrow new ELException(LocalMessages.get(\"error.method.literal.void\", expr));\n\t\t\t}\n\t\t} else if (!node.isMethodInvocation()) {\n\t\t\tif (!node.isLeftValue()) {\n\t\t\t\tthrow new ELException(LocalMessages.get(\"error.method.invalid\", expr));\n\t\t\t}\n\t\t\tif (paramTypes == null) {\n\t\t\t\tthrow new NullPointerException(LocalMessages.get(\"error.method.notypes\")); // EL specification requires NPE\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate String getStructuralId() {\n\t\tif (structure == null) {\n\t\t\tstructure = node.getStructuralId(bindings);\n\t\t}\n\t\treturn structure;\n\t}\n\t\n  /**\n   * Evaluates the expression and answers information about the method\n   * @param context used to resolve properties (<code>base.property</code> and <code>base[property]</code>)\n   * @return method information or <code>null</code> for literal expressions","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/de/odysseus/el/TreeMethodExpression.java#L74-L110","documentation":"TreeMethodExpression requires that a non-literal expression which is not a method invocation must at least be a left value (an assignable l-value). If the expression is neither a method invocation nor a left value, construction fails with 'error.method.invalid'.","triggerScenarios":"new TreeMethodExpression(...) with an expression like '#{a.b.c}' that resolves to something that is neither a method call nor an assignable property (e.g. an arithmetic result or a nested non-lvalue path).","commonSituations":"Typo in an expression (missing method name or parentheses); passing a value expression string where a method expression is required; version upgrades tightening validation.","solutions":["Correct the expression to a valid method invocation, e.g. '#{bean.method(...)}'.","If you meant a value binding, use TreeValueExpression instead of TreeMethodExpression.","Verify the parsed expression resolves to an l-value (property access) if intended as an l-value method target."],"exampleFix":"// before\nnew TreeMethodExpression(store, ctx, fns, vars, \"#{bean.prop + 1}\", null, Object.class)\n// after\nnew TreeMethodExpression(store, ctx, fns, vars, \"#{bean.compute()}\", null, Object.class)","handlingStrategy":"validation","validationCode":"// parse-check: expression must be a method invocation or an l-value\nif (!expr.matches(\"#\\{[^}]+\\}\") && !expr.matches(\"\\$\\{[^}]+\\}\")) {\n    // literal is ok, else it must resolve to a method or l-value at construction\n}","typeGuard":"boolean isValidMethodExpression(String expr) {\n    return expr.startsWith(\"#{\") && expr.contains(\"(\"); // method invocation form\n}","tryCatchPattern":"try {\n    TreeMethodExpression m = new TreeMethodExpression(store, ctx, fns, vars, expr, paramTypes, returnType);\n} catch (ELException e) {\n    // expression is neither a method invocation nor an l-value; fix the expression\n}","preventionTips":["Use method-invocation syntax (#{bean.method(...)}) for method expressions.","Use TreeValueExpression for value bindings instead of TreeMethodExpression.","Check expressions for typos like missing parentheses or non-assignable operands."],"tags":["el","method-expression","lvalue","flowable"],"backgroundTag":"invalid-argument-value","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}