{"record":{"id":"d3420438645bf327","repo":"flowable/flowable-engine","slug":"resourcename-is-null-d34204","errorCode":null,"errorMessage":"resourceName is null","messagePattern":"resourceName is null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/GetDeploymentResourceCmd.java","lineNumber":46,"sourceCode":" */\npublic class GetDeploymentResourceCmd implements Command<InputStream>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n    protected String deploymentId;\n    protected String resourceName;\n\n    public GetDeploymentResourceCmd(String deploymentId, String resourceName) {\n        this.deploymentId = deploymentId;\n        this.resourceName = resourceName;\n    }\n\n    @Override\n    public InputStream execute(CommandContext commandContext) {\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentId is null\");\n        }\n        if (resourceName == null) {\n            throw new FlowableIllegalArgumentException(\"resourceName is null\");\n        }\n\n        DmnResourceEntity resource = CommandContextUtil.getResourceEntityManager().findResourceByDeploymentIdAndResourceName(deploymentId, resourceName);\n        if (resource == null) {\n            if (CommandContextUtil.getDeploymentEntityManager(commandContext).findById(deploymentId) == null) {\n                throw new FlowableObjectNotFoundException(\"deployment does not exist: \" + deploymentId);\n            } else {\n                throw new FlowableObjectNotFoundException(\"no resource found with name '\" + resourceName + \"' in deployment '\" + deploymentId + \"'\");\n            }\n        }\n        return new ByteArrayInputStream(resource.getBytes());\n    }\n\n}\n","sourceCodeStart":28,"sourceCodeEnd":61,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/GetDeploymentResourceCmd.java#L28-L61","documentation":"In GetDeploymentResourceCmd.execute, after the deploymentId check, the resourceName is validated and a FlowableIllegalArgumentException is thrown when it is null. Both coordinates (deployment id + resource name) are needed to find the resource row via findResourceByDeploymentIdAndResourceName.","triggerScenarios":"getDeploymentResource(deploymentId, null) — resource name not set on the builder/command, or derived from a variable/config entry that resolved to null.","commonSituations":"Resource name stored in a properties file under a misspelled key so the map lookup yields null; refactoring renaming the resource without updating the constant used at lookup time.","solutions":["Pass the exact resource name as deployed (usually the .dmn XML file name, e.g. \"order-approval.dmn\")","Validate the name before calling the API","List available names first via dmnRepositoryService.getDeploymentResourceNames(deploymentId) to confirm the expected value"],"exampleFix":"// before\nrepoService.getDeploymentResource(deploymentId, config.get(\"resName\")); // null key\n// after\nString name = config.get(\"resName\");\nif (name == null) throw new IllegalArgumentException(\"resName config missing\");\nrepoService.getDeploymentResource(deploymentId, name);","handlingStrategy":"validation","validationCode":"if (resourceName == null || resourceName.isEmpty()) throw new IllegalArgumentException(\"resourceName is required\");","typeGuard":null,"tryCatchPattern":"try { repoService.getDeploymentResource(depId, name); } catch (FlowableIllegalArgumentException e) { if (e.getMessage().equals(\"resourceName is null\")) { throw new ConfigurationException(\"resource name missing\", e); } throw e; }","preventionTips":["Define DMN resource names as constants referenced by both deployment and lookup code","Verify config keys that supply resource names exist at startup","Confirm names via getDeploymentResourceNames before fetching bytes"],"tags":["flowable","dmn","null-argument","resource"],"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"}