{"record":{"id":"82fbed5c6a85c6b3","repo":"flowable/flowable-engine","slug":"deployment-id-is-null-82fbed","errorCode":null,"errorMessage":"Deployment id is null","messagePattern":"Deployment id is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/EventDeploymentQueryImpl.java","lineNumber":63,"sourceCode":"    protected String eventDefinitionKeyLike;\n    protected String channelDefinitionKey;\n    protected String channelDefinitionKeyLike;\n\n    public EventDeploymentQueryImpl() {\n    }\n\n    public EventDeploymentQueryImpl(CommandContext commandContext) {\n        super(commandContext);\n    }\n\n    public EventDeploymentQueryImpl(CommandExecutor commandExecutor) {\n        super(commandExecutor);\n    }\n\n    @Override\n    public EventDeploymentQueryImpl deploymentId(String deploymentId) {\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"Deployment id is null\");\n        }\n        this.deploymentId = deploymentId;\n        return this;\n    }\n\n    @Override\n    public EventDeploymentQueryImpl deploymentName(String deploymentName) {\n        if (deploymentName == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentName is null\");\n        }\n        this.name = deploymentName;\n        return this;\n    }\n\n    @Override\n    public EventDeploymentQueryImpl deploymentNameLike(String nameLike) {\n        if (nameLike == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentNameLike is null\");","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/EventDeploymentQueryImpl.java#L45-L81","documentation":"EventDeploymentQueryImpl.deploymentId sets an exact deployment-id filter on the deployment query. It throws FlowableIllegalArgumentException when deploymentId is null because a null id cannot match any deployment.","triggerScenarios":"Calling deploymentId(null), typically when the deployment id variable was never populated (deploy() result ignored or a null map lookup).","commonSituations":"Storing the deployment id from EventRepositoryService.deploy() and reading an unset field, config/property file lacking the deployment id, bean property never set in Spring wiring.","solutions":["Pass the deployment id returned by EventRepositoryService.deploy().getId()","Verify the variable/config holding the id is populated before querying","If no id is known, run the query without the deploymentId filter"],"exampleFix":"// before\nmanagementService.createEventDeploymentQuery().deploymentId(deploymentId).singleResult();\n// after\nObjects.requireNonNull(deploymentId, \"deploymentId must come from deploy().getId()\");\nmanagementService.createEventDeploymentQuery().deploymentId(deploymentId).singleResult();","handlingStrategy":"validation","validationCode":"if (deploymentId == null || deploymentId.isEmpty()) { throw new IllegalArgumentException(\"deploymentId must come from EventRepositoryService.deploy().getId()\"); }","typeGuard":"boolean hasText(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try { q.deploymentId(id).singleResult(); } catch (FlowableIllegalArgumentException e) { log.error(\"deploymentId is null: {}\", e.getMessage()); }","preventionTips":["Always capture the return of deploy(): EventDeployment d = repositoryService.deploy(); String id = d.getId();","Persist the deployment id immediately after deployment before it is needed elsewhere","Use Objects.requireNonNull on ids entering query-building code"],"tags":["flowable","query","null-argument","deployment"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}