flowable/flowable-engine · error · FlowableIllegalArgumentException

entityClass is null

Error message

entityClass is null

What it means

GetTableNameCmd maps an entity class to its database table name using EntityToTableMap and prepends the configured database table prefix. It throws FlowableIllegalArgumentException when the entityClass parameter is null, because a null class cannot be mapped to a table.

Solutions

  1. Pass the entity class literal, e.g. dmnManagementService.getTableName(HistoricDecisionExecutionEntityImpl.class)
  2. Fix the reflection/generic code that produced a null Class
  3. Verify the class passed is a DMN engine entity known to EntityToTableMap

Example fix

// before
String table = managementService.getTableName(entityClass); // entityClass may be null
// after
if (entityClass == null) {
    entityClass = HistoricDecisionExecutionEntityImpl.class;
}
String table = managementService.getTableName(entityClass);
Defensive patterns

Strategy: type-guard

Validate before calling

if (entityClass == null) {
    throw new IllegalArgumentException("entityClass required");
}

Type guard

boolean isEntityClass(Class<?> c) { return c != null && EntityToTableMap.getTableName(c) != null; }

Try / catch

try {
    table = managementService.getTableName(entityClass);
} catch (FlowableIllegalArgumentException e) {
    log.warn("getTableName called with null class");
    table = null;
}

Prevention

When it happens

Trigger: Calling DmnManagementService.getTableName(null) or building new GetTableNameCmd(null).

Common situations: Reflection code that resolved the entity Class dynamically and got null, generics erased to a null Class token, or passing a non-entity type through a generic helper.

Related errors


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

Appendix: source

Thrown at modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/GetTableNameCmd.java:37

import org.flowable.common.engine.api.FlowableIllegalArgumentException;
import org.flowable.common.engine.impl.interceptor.Command;
import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.flowable.dmn.engine.impl.db.EntityToTableMap;

public class GetTableNameCmd implements Command<String>, Serializable {

    private static final long serialVersionUID = 1L;

    private Class<?> entityClass;

    public GetTableNameCmd(Class<?> entityClass) {
        this.entityClass = entityClass;
    }

    @Override
    public String execute(CommandContext commandContext) {
        if (entityClass == null) {
            throw new FlowableIllegalArgumentException("entityClass is null");
        }
        String databaseTablePrefix = getDbSqlSession(commandContext).getDbSqlSessionFactory().getDatabaseTablePrefix();
        String tableName = EntityToTableMap.getTableName(entityClass);

        return databaseTablePrefix + tableName;
    }

}

View on GitHub (pinned to d6d39ce1c6)