flowable/flowable-engine · error · FlowableIllegalArgumentException

resourceName is null

Error message

resourceName is null

What it means

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.

Source

Thrown at modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/GetDeploymentResourceCmd.java:46

 */
public class GetDeploymentResourceCmd implements Command<InputStream>, Serializable {

    private static final long serialVersionUID = 1L;
    protected String deploymentId;
    protected String resourceName;

    public GetDeploymentResourceCmd(String deploymentId, String resourceName) {
        this.deploymentId = deploymentId;
        this.resourceName = resourceName;
    }

    @Override
    public InputStream execute(CommandContext commandContext) {
        if (deploymentId == null) {
            throw new FlowableIllegalArgumentException("deploymentId is null");
        }
        if (resourceName == null) {
            throw new FlowableIllegalArgumentException("resourceName is null");
        }

        DmnResourceEntity resource = CommandContextUtil.getResourceEntityManager().findResourceByDeploymentIdAndResourceName(deploymentId, resourceName);
        if (resource == null) {
            if (CommandContextUtil.getDeploymentEntityManager(commandContext).findById(deploymentId) == null) {
                throw new FlowableObjectNotFoundException("deployment does not exist: " + deploymentId);
            } else {
                throw new FlowableObjectNotFoundException("no resource found with name '" + resourceName + "' in deployment '" + deploymentId + "'");
            }
        }
        return new ByteArrayInputStream(resource.getBytes());
    }

}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Pass the exact resource name as deployed (usually the .dmn XML file name, e.g. "order-approval.dmn")
  2. Validate the name before calling the API
  3. List available names first via dmnRepositoryService.getDeploymentResourceNames(deploymentId) to confirm the expected value

Example fix

// before
repoService.getDeploymentResource(deploymentId, config.get("resName")); // null key
// after
String name = config.get("resName");
if (name == null) throw new IllegalArgumentException("resName config missing");
repoService.getDeploymentResource(deploymentId, name);
Defensive patterns

Strategy: validation

Validate before calling

if (resourceName == null || resourceName.isEmpty()) throw new IllegalArgumentException("resourceName is required");

Try / catch

try { repoService.getDeploymentResource(depId, name); } catch (FlowableIllegalArgumentException e) { if (e.getMessage().equals("resourceName is null")) { throw new ConfigurationException("resource name missing", e); } throw e; }

Prevention

When it happens

Trigger: getDeploymentResource(deploymentId, null) — resource name not set on the builder/command, or derived from a variable/config entry that resolved to null.

Common situations: 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.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/d3420438645bf327. Report an issue: GitHub.