{"record":{"id":"f0e8ff8d66992fc8","repo":"flowable/flowable-engine","slug":"unabled-to-create-expressionfactory-of-type-cla","errorCode":null,"errorMessage":"Unabled to create ExpressionFactory of type '${clazz.getName()}'","messagePattern":"Unabled to create ExpressionFactory of type '(.+?)'","errorType":"exception","errorClass":"ELException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/javax/el/ExpressionFactory.java","lineNumber":210,"sourceCode":"                try {\n                    constructor = clazz.getConstructor(Properties.class);\n                } catch (SecurityException se) {\n                    throw new ELException(se);\n                } catch (NoSuchMethodException nsme) {\n                    // This can be ignored\n                    // This is OK for this constructor not to exist\n                }\n            }\n            if (constructor == null) {\n                result = (ExpressionFactory) clazz.getConstructor().newInstance();\n            } else {\n                result = (ExpressionFactory) constructor.newInstance(properties);\n            }\n\n        } catch (InvocationTargetException e) {\n            Throwable cause = e.getCause();\n            Util.handleThrowable(cause);\n            throw new ELException(\"Unabled to create ExpressionFactory of type '\" + clazz.getName() + \"'\", e);\n        } catch (ReflectiveOperationException | IllegalArgumentException e) {\n            throw new ELException(\"Unabled to create ExpressionFactory of type '\" + clazz.getName() + \"'\", e);\n        }\n\n        return result;\n    }\n\n    /**\n     * Create a new value expression.\n     *\n     * @param context The EL context for this evaluation\n     * @param expression The String representation of the value expression\n     * @param expectedType The expected type of the result of evaluating the expression\n     * @return A new value expression formed from the input parameters\n     * @throws NullPointerException If the expected type is <code>null</code>\n     * @throws ELException If there are syntax errors in the provided expression\n     */\n    public abstract ValueExpression createValueExpression(ELContext context, String expression, Class<?> expectedType);","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/ExpressionFactory.java#L192-L228","documentation":"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 ...'.","triggerScenarios":"The configured ExpressionFactory class was found and instantiated reflectively, but its constructor (possibly taking a Properties argument) threw an exception.","commonSituations":"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.","solutions":["Inspect the wrapped cause exception to find the real constructor failure","Fix the properties passed to the factory constructor","Simplify to the no-arg variant ExpressionFactory.newInstance() so no properties constructor is invoked","Fix or replace the broken custom factory implementation"],"exampleFix":"// before\nExpressionFactory.newInstance(\"my.BadFactory\", props); // constructor throws on props\n// after\nExpressionFactory.newInstance(); // default factory, no-arg","handlingStrategy":"try-catch","validationCode":"// Verify the factory can be constructed before handing it to the engine\nfactoryClass.getDeclaredConstructor().newInstance();","typeGuard":null,"tryCatchPattern":"try {\n  factory = ExpressionFactory.newInstance(className, properties);\n} catch (ELException e) {\n  logger.error(\"Factory ctor failed\", e.getCause());\n  throw new IllegalStateException(\"Bad ExpressionFactory config\", e);\n}","preventionTips":["Inspect e.getCause() to see the real constructor failure","Only pass properties to factories documented to accept a Properties constructor","Smoke-test custom factories in unit tests"],"tags":["el","reflection","constructor","initialization"],"backgroundTag":"invalid-constructor-argument","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"}