flowable/flowable-engine · error · ELException

Unabled to create ExpressionFactory of type '${clazz.getName

Error message

Unabled to create ExpressionFactory of type '${clazz.getName()}'

What it means

ExpressionFactory.newInstance wraps InvocationTargetException in ELException when the factory implementation's constructor throws — the underlying cause was not a handled Throwable. Message: 'Unabled to create ExpressionFactory of type ...'.

Source

Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/javax/el/ExpressionFactory.java:210

                try {
                    constructor = clazz.getConstructor(Properties.class);
                } catch (SecurityException se) {
                    throw new ELException(se);
                } catch (NoSuchMethodException nsme) {
                    // This can be ignored
                    // This is OK for this constructor not to exist
                }
            }
            if (constructor == null) {
                result = (ExpressionFactory) clazz.getConstructor().newInstance();
            } else {
                result = (ExpressionFactory) constructor.newInstance(properties);
            }

        } catch (InvocationTargetException e) {
            Throwable cause = e.getCause();
            Util.handleThrowable(cause);
            throw new ELException("Unabled to create ExpressionFactory of type '" + clazz.getName() + "'", e);
        } catch (ReflectiveOperationException | IllegalArgumentException e) {
            throw new ELException("Unabled to create ExpressionFactory of type '" + clazz.getName() + "'", e);
        }

        return result;
    }

    /**
     * Create a new value expression.
     *
     * @param context The EL context for this evaluation
     * @param expression The String representation of the value expression
     * @param expectedType The expected type of the result of evaluating the expression
     * @return A new value expression formed from the input parameters
     * @throws NullPointerException If the expected type is <code>null</code>
     * @throws ELException If there are syntax errors in the provided expression
     */
    public abstract ValueExpression createValueExpression(ELContext context, String expression, Class<?> expectedType);

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Inspect the wrapped cause exception to find the real constructor failure
  2. Fix the properties passed to the factory constructor
  3. Simplify to the no-arg variant ExpressionFactory.newInstance() so no properties constructor is invoked
  4. Fix or replace the broken custom factory implementation

Example fix

// before
ExpressionFactory.newInstance("my.BadFactory", props); // constructor throws on props
// after
ExpressionFactory.newInstance(); // default factory, no-arg
Defensive patterns

Strategy: try-catch

Validate before calling

// Verify the factory can be constructed before handing it to the engine
factoryClass.getDeclaredConstructor().newInstance();

Try / catch

try {
  factory = ExpressionFactory.newInstance(className, properties);
} catch (ELException e) {
  logger.error("Factory ctor failed", e.getCause());
  throw new IllegalStateException("Bad ExpressionFactory config", e);
}

Prevention

When it happens

Trigger: The configured ExpressionFactory class was found and instantiated reflectively, but its constructor (possibly taking a Properties argument) threw an exception.

Common situations: Custom ExpressionFactory implementations whose constructors fail on bad properties, missing files, or initialization errors; passing properties to factories that don't accept a Properties constructor.

Related errors


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