{"record":{"id":"c6b2bda8a3eaa970","repo":"flowable/flowable-engine","slug":"deploymentcategory-is-null-c6b2bd","errorCode":null,"errorMessage":"deploymentCategory is null","messagePattern":"deploymentCategory is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/DeploymentQueryImpl.java","lineNumber":84,"sourceCode":"            throw new ActivitiIllegalArgumentException(\"deploymentName is null\");\n        }\n        this.name = deploymentName;\n        return this;\n    }\n\n    @Override\n    public DeploymentQueryImpl deploymentNameLike(String nameLike) {\n        if (nameLike == null) {\n            throw new ActivitiIllegalArgumentException(\"deploymentNameLike is null\");\n        }\n        this.nameLike = nameLike;\n        return this;\n    }\n\n    @Override\n    public DeploymentQueryImpl deploymentCategory(String deploymentCategory) {\n        if (deploymentCategory == null) {\n            throw new ActivitiIllegalArgumentException(\"deploymentCategory is null\");\n        }\n        this.category = deploymentCategory;\n        return this;\n    }\n\n    @Override\n    public DeploymentQueryImpl deploymentCategoryNotEquals(String deploymentCategoryNotEquals) {\n        if (deploymentCategoryNotEquals == null) {\n            throw new ActivitiIllegalArgumentException(\"deploymentCategoryExclude is null\");\n        }\n        this.categoryNotEquals = deploymentCategoryNotEquals;\n        return this;\n    }\n\n    @Override\n    public DeploymentQueryImpl deploymentTenantId(String tenantId) {\n        if (tenantId == null) {\n            throw new ActivitiIllegalArgumentException(\"deploymentTenantId is null\");","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/DeploymentQueryImpl.java#L66-L102","documentation":"DeploymentQueryImpl.deploymentCategory() throws ActivitiIllegalArgumentException when the deploymentCategory argument is null. Categories are optional filters, but once you invoke this method the library requires a concrete value for the query predicate.","triggerScenarios":"Calling repositoryService.createDeploymentQuery().deploymentCategory(null), typically when category is an optional configuration or request parameter forwarded unchecked.","commonSituations":"Multi-tenant setups where category is configurable; deployments made without a category and code assuming a default value exists; missing property in a config file.","solutions":["Pass a non-null category string","Only add the category filter when a value is configured/present","Set an explicit category at deployment time (DeploymentBuilder.category(...)) so downstream queries have a value","Fix the config source returning null for the category"],"exampleFix":"// before\nDeploymentQuery q = repositoryService.createDeploymentQuery().deploymentCategory(props.getCategory());\n// after\nDeploymentQuery q = repositoryService.createDeploymentQuery();\nString category = props.getCategory();\nif (category != null) {\n    q = q.deploymentCategory(category);\n}","handlingStrategy":"validation","validationCode":"if (category == null) { throw new IllegalArgumentException(\"category must not be null\"); }\nrepositoryService.createDeploymentQuery().deploymentCategory(category)...","typeGuard":"boolean hasCategory(Properties p) { return p.getProperty(\"deployment.category\") != null; }","tryCatchPattern":"try {\n    repositoryService.createDeploymentQuery().deploymentCategory(category).list();\n} catch (ActivitiIllegalArgumentException e) {\n    log.error(\"deploymentCategory was null\", e);\n}","preventionTips":["Provide explicit defaults for category configuration","Set a category on every deployment so filters have targets","Wrap optional config-driven filters in null checks"],"tags":["java","activiti","null-argument","query"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}