flowable/flowable-engine · error · NullPointerException

error.value.notype

error.value.notype

Error message

error.value.notype

What it means

TreeValueExpression must know the expected type the expression result will be coerced to. The constructor throws a NullPointerException (message 'error.value.notype') when the type parameter is null, as required by the EL specification.

Source

Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/de/odysseus/el/TreeValueExpression.java:80

	 * @param functions the function mapper used to bind functions
	 * @param variables the variable mapper used to bind variables
	 * @param expr the expression string
	 * @param type the expected type (may be <code>null</code>)
	 */
	public TreeValueExpression(TreeStore store, FunctionMapper functions, VariableMapper variables, TypeConverter converter, String expr, Class<?> type) {
		super();

		Tree tree = store.get(expr);

		this.builder = store.getBuilder();
		this.bindings = tree.bind(functions, variables, converter);
		this.expr = expr;
		this.type = type;
		this.node = tree.getRoot();
		this.deferred = tree.isDeferred();
		
		if (type == null) {
			throw new NullPointerException(LocalMessages.get("error.value.notype"));
		}
	}

	private String getStructuralId() {
		if (structure == null) {
			structure = node.getStructuralId(bindings);
		}
		return structure;
	}
	
	@Override
	public Class<?> getExpectedType() {
		return type;
	}

	@Override
	public String getExpressionString() {
		return expr;

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Pass an explicit Class as the expected type, e.g. String.class or Object.class if coercion is unrestricted.
  2. Default computed types to Object.class when unknown before constructing the expression.
  3. Trace where the type comes from and fix the supplier that returned null.

Example fix

// before
new TreeValueExpression(store, ctx, fns, vars, "#{bean.name}", null)
// after
new TreeValueExpression(store, ctx, fns, vars, "#{bean.name}", String.class)
Defensive patterns

Strategy: validation

Validate before calling

if (expectedType == null) {
    throw new IllegalArgumentException("TreeValueExpression requires a non-null expected type");
}

Type guard

boolean validTypeArg(Class<?> type) { return type != null; }

Try / catch

try {
    TreeValueExpression v = new TreeValueExpression(store, ctx, fns, vars, expr, type);
} catch (NullPointerException e) {
    // type was null; pass Object.class or the concrete expected type
}

Prevention

When it happens

Trigger: new TreeValueExpression(store, context, functions, variables, expr, null).

Common situations: Passing a null expected type from a generic helper method or when the target type is derived from reflection that failed; framework integrations that dropped the type information.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/36c69b473c0ab3d5. Report an issue: GitHub.