{"record":{"id":"3633fffb2a47d493","repo":"flowable/flowable-engine","slug":"deploymentkey-is-null-3633ff","errorCode":null,"errorMessage":"deploymentKey is null","messagePattern":"deploymentKey is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/DeploymentQueryImpl.java","lineNumber":132,"sourceCode":"            throw new FlowableIllegalArgumentException(\"deploymentCategoryLike is null\");\n        }\n        this.categoryLike = categoryLike;\n        return this;\n    }\n\n    @Override\n    public DeploymentQueryImpl deploymentCategoryNotEquals(String deploymentCategoryNotEquals) {\n        if (deploymentCategoryNotEquals == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentCategoryExclude is null\");\n        }\n        this.categoryNotEquals = deploymentCategoryNotEquals;\n        return this;\n    }\n\n    @Override\n    public DeploymentQueryImpl deploymentKey(String deploymentKey) {\n        if (deploymentKey == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentKey is null\");\n        }\n        this.key = deploymentKey;\n        return this;\n    }\n\n    @Override\n    public DeploymentQueryImpl deploymentKeyLike(String deploymentKeyLike) {\n        if (deploymentKeyLike == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentKeyLike is null\");\n        }\n        this.keyLike = deploymentKeyLike;\n        return this;\n    }\n\n    @Override\n    public DeploymentQueryImpl deploymentTenantId(String tenantId) {\n        if (tenantId == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentTenantId is null\");","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/DeploymentQueryImpl.java#L114-L150","documentation":"DeploymentQueryImpl.deploymentKey(String) throws FlowableIllegalArgumentException when the deploymentKey argument is null. Deployments may carry a key (set via DeploymentBuilder.key(...)); this filter matches it exactly, and Flowable validates the argument eagerly at builder time so null never reaches SQL execution.","triggerScenarios":"repositoryService.createDeploymentQuery().deploymentKey(null), usually when the key comes from process definition metadata, a request parameter, or a lookup that returned null.","commonSituations":"Older deployments created before keys were introduced (key is null in the DB while query code assumes one); model/config fields for the key not populated.","solutions":["Pass a non-null key string that was set at deploy time via DeploymentBuilder.key(...).","Guard: if (deploymentKey != null) query.deploymentKey(deploymentKey).","If the target deployment has no key, filter by name or id instead."],"exampleFix":"// before\nquery.deploymentKey(deploymentKey); // throws when null\n// after\nif (deploymentKey != null) {\n    query.deploymentKey(deploymentKey);\n}","handlingStrategy":"validation","validationCode":"if (deploymentKey == null || deploymentKey.isEmpty()) {\n    throw new IllegalArgumentException(\"A non-empty deployment key is required\");\n}","typeGuard":"boolean isValidDeploymentKey(String key) { return key != null && !key.trim().isEmpty(); }","tryCatchPattern":"try {\n    query.deploymentKey(deploymentKey);\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"Null deployment key filter ignored\", e);\n}","preventionTips":["Always set a key via DeploymentBuilder.key(...) so queries by key are possible","Validate keys at API boundaries before building queries","Fall back to name/id filters for legacy deployments without keys"],"tags":["flowable","query-builder","null-argument","deployment-key"],"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"}