flowable/flowable-engine · warning · FlowableIllegalArgumentException
deploymentId is null
Error message
deploymentId is null
What it means
FlowableIllegalArgumentException thrown by GetDeploymentResourceCmd.execute when deploymentId is null. The command fetches a resource byte stream from a deployment, which requires both a deployment id and a resource name. This is an immediate argument validation failure before any entity lookup.
Source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetDeploymentResourceCmd.java:44
/**
* @author Joram Barrez
*/
public class GetDeploymentResourceCmd implements Command<InputStream>, Serializable {
private static final long serialVersionUID = 1L;
protected String deploymentId;
protected String resourceName;
public GetDeploymentResourceCmd(String deploymentId, String resourceName) {
this.deploymentId = deploymentId;
this.resourceName = resourceName;
}
@Override
public InputStream execute(CommandContext commandContext) {
if (deploymentId == null) {
throw new FlowableIllegalArgumentException("deploymentId is null");
}
if (resourceName == null) {
throw new FlowableIllegalArgumentException("resourceName is null");
}
ResourceEntity resource = CommandContextUtil.getResourceEntityManager().findResourceByDeploymentIdAndResourceName(deploymentId, resourceName);
if (resource == null) {
if (CommandContextUtil.getDeploymentEntityManager(commandContext).findById(deploymentId) == null) {
throw new FlowableObjectNotFoundException("deployment does not exist: " + deploymentId, Deployment.class);
} else {
throw new FlowableObjectNotFoundException("no resource found with name '" + resourceName + "' in deployment '" + deploymentId + "'", InputStream.class);
}
}
return new ByteArrayInputStream(resource.getBytes());
}
}
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Guard deploymentId for null before calling; fail with your own descriptive error.
- Resolve a valid deploymentId via RepositoryService.createDeploymentQuery().deploymentKey(...).latest().singleResult().getId().
- Catch FlowableIllegalArgumentException and map to a client input/validation error.
- Check your data source: if the id came from a DB column or API payload, fix the missing value at that source.
Example fix
// before
repositoryService.getResource(deployment.getId(), name);
// after
if (deploymentId == null) throw new IllegalArgumentException("deploymentId required");
repositoryService.getResource(deploymentId, name); Defensive patterns
Strategy: validation
Validate before calling
if (deploymentId == null || deploymentId.isBlank())
throw new IllegalArgumentException("deploymentId is required"); Type guard
Optional<String> requireDeploymentId(String id) {
return Optional.ofNullable(id).filter(s -> !s.isBlank());
} Try / catch
try {
return repositoryService.getResource(deploymentId, resourceName);
} catch (FlowableIllegalArgumentException e) {
throw new BadRequestException("deploymentId is required and must not be null", e);
} Prevention
- Null-check deployment ids obtained from lookups before use.
- Use @NotNull validation on API request fields carrying deploymentId.
- Propagate Optional/nullable results explicitly instead of auto-unboxing nulls.
- Add integration tests for resource fetch with missing ids.
When it happens
Trigger: Calling repositoryService.getResource(deploymentId, resourceName) where deploymentId came from an uninitialized variable, a failed lookup that returned null, or a null column in your own data model.
Common situations: Chaining getResource after a query that returned no deployment (null id); deserializing ids from JSON where the field was absent; passing deployment name instead of id (null after lookup).
Related errors
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/67f0fb65ce88476f.
Report an issue: GitHub.