{"record":{"id":"ccc2131812eff0c3","repo":"flowable/flowable-engine","slug":"id-is-null-ccc213","errorCode":null,"errorMessage":"id is null","messagePattern":"id is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ProcessDefinitionQueryImpl.java","lineNumber":141,"sourceCode":"            throw new ActivitiIllegalArgumentException(\"name is null\");\n        }\n        this.name = name;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionNameLike(String nameLike) {\n        if (nameLike == null) {\n            throw new ActivitiIllegalArgumentException(\"nameLike is null\");\n        }\n        this.nameLike = nameLike;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl deploymentId(String deploymentId) {\n        if (deploymentId == null) {\n            throw new ActivitiIllegalArgumentException(\"id is null\");\n        }\n        this.deploymentId = deploymentId;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl deploymentIds(Set<String> deploymentIds) {\n        if (deploymentIds == null) {\n            throw new ActivitiIllegalArgumentException(\"ids are null\");\n        }\n        this.deploymentIds = deploymentIds;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionKey(String key) {\n        if (key == null) {\n            throw new ActivitiIllegalArgumentException(\"key is null\");","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ProcessDefinitionQueryImpl.java#L123-L159","documentation":"ProcessDefinitionQueryImpl.deploymentId(String) throws ActivitiIllegalArgumentException 'id is null' when the deploymentId argument is null. The engine validates the deployment filter eagerly so the resulting SQL predicate is always well-formed. Passing null here is a caller contract violation.","triggerScenarios":"Calling ProcessDefinitionQuery.deploymentId(null), typically when the deployment id comes from an uninitialized variable, a missing request parameter, or a lookup that returned null before building the query.","commonSituations":"REST handlers forwarding an absent path/query parameter; resolving a deployment by name first and passing the (null) result of a failed lookup; bean/config wiring where the deployment id property was never set.","solutions":["Pass a real deployment id obtained from RepositoryService.createDeploymentQuery() or the deployment result","If the deployment filter is optional, guard the call with a null check","Resolve the id earlier and fail fast with a clear 'deployment not found' error instead of a null argument","Catch ActivitiIllegalArgumentException and return a validation error to the caller"],"exampleFix":"// before\nProcessDefinitionQuery q = repoService.createProcessDefinitionQuery()\n    .deploymentId(findDeploymentId(name)); // may be null\n// after\nString depId = findDeploymentId(name);\nif (depId == null) {\n    throw new DeploymentNotFoundException(name);\n}\nProcessDefinitionQuery q = repoService.createProcessDefinitionQuery().deploymentId(depId);","handlingStrategy":"validation","validationCode":"if (deploymentId == null || deploymentId.isEmpty()) throw new IllegalArgumentException(\"deploymentId is required\");\nquery.deploymentId(deploymentId);","typeGuard":"boolean isNonBlank(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try {\n    query.deploymentId(deploymentId);\n} catch (ActivitiIllegalArgumentException e) {\n    if (e.getMessage().contains(\"id is null\")) {\n        throw new BadRequestException(\"deploymentId must not be null\");\n    }\n    throw e;\n}","preventionTips":["Resolve deployment ids from RepositoryService.createDeploymentQuery() and verify non-null","Validate request parameters at the controller layer before building queries","Avoid chaining lookups whose null result is silently passed as an argument","Fail fast with domain errors (deployment-not-found) instead of null arguments"],"tags":["java","null-argument","query-builder","activiti","validation"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}