flowable/flowable-engine · error · FlowableIllegalArgumentException

deploymentId is null

Error message

deploymentId is null

What it means

GetDeploymentResourceNamesCmd returns the resource name list for a deployment. A null deploymentId is rejected immediately with FlowableIllegalArgumentException because the deployment manager query cannot run without the id.

Source

Thrown at modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/cmd/GetDeploymentResourceNamesCmd.java:38

import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.flowable.eventregistry.impl.util.CommandContextUtil;

/**
 * @author Joram Barrez
 */
public class GetDeploymentResourceNamesCmd implements Command<List<String>>, Serializable {

    private static final long serialVersionUID = 1L;
    protected String deploymentId;

    public GetDeploymentResourceNamesCmd(String deploymentId) {
        this.deploymentId = deploymentId;
    }

    @Override
    public List<String> execute(CommandContext commandContext) {
        if (deploymentId == null) {
            throw new FlowableIllegalArgumentException("deploymentId is null");
        }

        return CommandContextUtil.getDeploymentEntityManager(commandContext).getDeploymentResourceNames(deploymentId);
    }

}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Capture the id from EventRepositoryService.createDeployment().addX(...).deploy().getId() and pass it
  2. Null-check the id before invoking the command
  3. Persist the deployment id (e.g. in config/DB) instead of re-resolving it at call time

Example fix

// before
List<String> names = eventRepositoryService.getDeploymentResourceNames(deploymentId); // null
// after
EventDeployment dep = eventRepositoryService.createDeployment().addClasspathResource("order.event.json").deploy();
List<String> names = eventRepositoryService.getDeploymentResourceNames(dep.getId());
Defensive patterns

Strategy: validation

Validate before calling

if (deploymentId == null || deploymentId.isEmpty()) {
    throw new IllegalArgumentException("deploymentId required");
}

Type guard

boolean hasDeploymentId = deploymentId != null && !deploymentId.trim().isEmpty();

Try / catch

try {
    List<String> names = eventRepositoryService.getDeploymentResourceNames(deploymentId);
} catch (FlowableIllegalArgumentException e) {
    log.error("deploymentId missing: {}", e.getMessage());
}

Prevention

When it happens

Trigger: Calling the corresponding repository/EventRepositoryService API or executing the command with deploymentId null, typically because the deployment id variable was never assigned from a deploy() result.

Common situations: Ignoring the EventDeployment returned by deploy(); failed deployment left the id unset; passing a process-engine deployment id variable that is null in this context.

Related errors


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