flowable/flowable-engine · error · FlowableIllegalArgumentException
name is null
Error message
name is null
What it means
GetUsersWithPrivilegeCmd lists all users that hold a named privilege (e.g. 'access-rest-api'). The privilege name is the lookup key, so the constructor validates it immediately and throws FlowableIllegalArgumentException when null.
Source
Thrown at modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/cmd/GetUsersWithPrivilegeCmd.java:36
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.idm.api.User;
import org.flowable.idm.engine.impl.util.CommandContextUtil;
/**
* @author Joram Barrez
*/
public class GetUsersWithPrivilegeCmd implements Command<List<User>>, Serializable {
private static final long serialVersionUID = 1L;
protected String name;
public GetUsersWithPrivilegeCmd(String name) {
if (name == null) {
throw new FlowableIllegalArgumentException("name is null");
}
this.name = name;
}
@Override
public List<User> execute(CommandContext commandContext) {
return CommandContextUtil.getUserEntityManager(commandContext).findUsersByPrivilegeId(name);
}
}
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Pass a concrete privilege name string, e.g. new GetUsersWithPrivilegeCmd("access-idm")
- Validate the privilege-name source (config/variable) before invoking the query
- Catch FlowableIllegalArgumentException if a null name should degrade to an empty result
Example fix
// before
List<User> users = identityService.createUserQuery().privilegeName(privilegeName).list();
// after
List<User> users = privilegeName != null
? identityService.createUserQuery().privilegeName(privilegeName).list()
: Collections.emptyList(); Defensive patterns
Strategy: validation
Validate before calling
if (privilegeName == null || privilegeName.isEmpty()) throw new IllegalArgumentException("privilege name is required"); Type guard
boolean hasPrivilegeName(String name) { return name != null && !name.trim().isEmpty(); } Try / catch
try { users = identityService.createUserQuery().privilegeName(name).list(); } catch (FlowableIllegalArgumentException e) { users = Collections.emptyList(); } Prevention
- Define privilege names as constants instead of ad-hoc strings
- Validate config properties for privilege names at startup
- Never forward raw request parameters as privilege names without checks
When it happens
Trigger: Calling identityService.createUserQuery().privilegeName(null) (which constructs this command) or new GetUsersWithPrivilegeCmd(null) directly.
Common situations: Privilege name sourced from a config property or process variable that is unset; passing a variable holding a null privilege name in identity-management admin tooling.
Related errors
- Privilege name is null
- Could not find or create ${privilegeName} privilege
- Provided email is null
- Provided emailLike is null
- Provided groupId is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/ea7f0868a4814ba2.
Report an issue: GitHub.