Activiti/Activiti · error · ActivitiIllegalArgumentException
entityClass is null
Error message
entityClass is null
What it means
Thrown by GetTableNameCmd.execute when entityClass is null. The command validates the argument with ActivitiIllegalArgumentException before asking TableDataManager.getTableName(entityClass, true) to map the entity class to its physical table name.
Solutions
- Null-check entityClass before the call.
- Pass one of Activiti's entity classes/interfaces documented for ManagementService.getTableName.
- Handle Class.forName failures explicitly instead of letting null propagate.
Example fix
// before
String table = managementService.getTableName(entityClass);
// after
if (entityClass == null) throw new IllegalArgumentException("entityClass is required");
String table = managementService.getTableName(entityClass); Defensive patterns
Strategy: validation
Validate before calling
if (entityClass == null) throw new IllegalArgumentException("entityClass is required"); Type guard
boolean isValidEntityClass(Class<?> c) {
return c != null;
} Prevention
- Pass Activiti entity interfaces/classes explicitly.
- Fail fast on Class.forName errors instead of propagating null.
- Don't confuse DTOs with engine entity classes.
When it happens
Trigger: Calling managementService.getTableName(null), or passing a Class variable resolved reflectively where resolution failed and returned null.
Common situations: Reflection-based lookup that failed silently; generic helper receiving a null Class; confusion between entity class and DTO class.
Related errors
- tableName is null
- Candidate group list is null
- Cannot start process instance by message: message name is…
- dataObjectName is null
- Deployment id is null
AI-assisted analysis of Activiti/Activiti@56435b1a97 (2026-09-09).
Data as JSON: /api/errors/09f4975724f97d8b.
Report an issue: GitHub.
Appendix: source
Thrown at activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/cmd/GetTableNameCmd.java:35
import java.io.Serializable;
import org.activiti.engine.ActivitiIllegalArgumentException;
import org.activiti.engine.impl.interceptor.Command;
import org.activiti.engine.impl.interceptor.CommandContext;
public class GetTableNameCmd implements Command<String>, Serializable {
private static final long serialVersionUID = 1L;
private Class<?> entityClass;
public GetTableNameCmd(Class<?> entityClass) {
this.entityClass = entityClass;
}
public String execute(CommandContext commandContext) {
if (entityClass == null) {
throw new ActivitiIllegalArgumentException("entityClass is null");
}
return commandContext.getTableDataManager().getTableName(entityClass, true);
}
}
View on GitHub (pinned to 56435b1a97)