flowable/flowable-engine · error · NullPointerException
context is null
Error message
context is null
What it means
JsonNodeELResolver.getType() implements the JUEL/EL contract, which mandates an immediate NullPointerException when the passed ELContext is null before doing any resolution. It is a defensive precondition check protecting the resolver's use of context.setPropertyResolved().
Solutions
- Always pass a valid, non-null ELContext (e.g. StandardELContext or the engine-provided context)
- In custom callers, assert/initialize the ELContext before invoking resolver methods
- Use the resolver only through a proper EL processor (ExpressionFactory) which supplies the context automatically
Example fix
// before resolver.getType(null, jsonNode, "field"); // NPE // after ELContext ctx = factory.getELContext(resolver); resolver.getType(ctx, jsonNode, "field");
Defensive patterns
Strategy: validation
Validate before calling
if (context == null) {
throw new IllegalArgumentException("An ELContext is required before calling JsonNodeELResolver.getType");
}
resolver.getType(context, base, property); Type guard
boolean ready = context != null; // establish before invoking resolver if (!ready) context = factory.getELContext(resolver);
Try / catch
try {
return resolver.getType(context, base, property);
} catch (NullPointerException e) {
if ("context is null".equals(e.getMessage())) {
throw new IllegalArgumentException("ELContext must be provided to JsonNodeELResolver", e);
}
throw e;
} Prevention
- Always obtain the ELContext from an ExpressionFactory rather than passing null
- Never call ELResolver methods directly with a null context in tests
- Wrap resolver access in a helper that initializes the context lazily
When it happens
Trigger: Calling resolver.getType(context, base, property) programmatically with a null ELContext; an EL implementation invoking the resolver without a context.
Common situations: Custom code or tests invoking the ELResolver API directly and forgetting the context argument; embedding JsonNodeELResolver in a non-Flowable EL setup where the context is not wired.
Related errors
- activity tenant id is null
- activityId is null
- after time is null
- batch has to be provided
- batchId is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/67a3738407c409ff.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/el/JsonNodeELResolver.java:87
* this resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value. Assuming the base is a Map, this method will always return
* Object.class. This is because Maps accept any object as the value for a given key.
*
* @param context
* The context of this evaluation.
* @param base
* The map to analyze. Only bases of type Map are handled by this resolver.
* @param property
* The key to return the acceptable type for. Ignored by this resolver.
* @return If the propertyResolved property of ELContext was set to true, then the most general acceptable type; otherwise undefined.
* @throws NullPointerException
* if context is null
* @throws ELException
* if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.
*/
@Override
public Class<?> getType(ELContext context, Object base, Object property) {
if (context == null) {
throw new NullPointerException("context is null");
}
Class<?> result = null;
if (isResolvable(base)) {
result = Object.class;
context.setPropertyResolved(true);
}
return result;
}
/**
* If the base object is a map, returns the value associated with the given key, as specified by the property argument. If the key was not found, null is returned. If the base is a Map, the
* propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller should ignore the
* return value. Just as in java.util.Map.get(Object), just because null is returned doesn't mean there is no mapping for the key; it's also possible that the Map explicitly maps the key to null.
*
* @param context
* The context of this evaluation.
* @param base
* The map to analyze. Only bases of type Map are handled by this resolver.View on GitHub (pinned to d6d39ce1c6)