{"record":{"id":"b3e65a977120aec2","repo":"flowable/flowable-engine","slug":"path-can-not-be-null-or-empty-syntax-b3e65a","errorCode":null,"errorMessage":"Path can not be null or empty. Syntax: ","messagePattern":"Path can not be null or empty\\. Syntax: ","errorType":"exception","errorClass":"MalformedURLException","httpStatus":null,"severity":"error","filePath":"modules/flowable-osgi/src/main/java/org/flowable/osgi/BpmnURLHandler.java","lineNumber":52,"sourceCode":"    private static final Logger LOGGER = LoggerFactory.getLogger(BpmnURLHandler.class);\n\n    private static final String SYNTAX = \"bpmn: bpmn-xml-uri\";\n\n    private URL bpmnXmlURL;\n\n    /**\n     * Open the connection for the given URL.\n     * \n     * @param url\n     *            the url from which to open a connection.\n     * @return a connection on the specified URL.\n     * @throws IOException\n     *             if an error occurs or if the URL is malformed.\n     */\n    @Override\n    public URLConnection openConnection(URL url) throws IOException {\n        if (url.getPath() == null || url.getPath().trim().length() == 0) {\n            throw new MalformedURLException(\"Path can not be null or empty. Syntax: \" + SYNTAX);\n        }\n        bpmnXmlURL = new URL(url.getPath());\n\n        LOGGER.debug(\"BPMN xml URL is: [{}]\", bpmnXmlURL);\n        return new Connection(url);\n    }\n\n    public URL getBpmnXmlURL() {\n        return bpmnXmlURL;\n    }\n\n    public class Connection extends URLConnection {\n\n        public Connection(URL url) {\n            super(url);\n        }\n\n        @Override","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-osgi/src/main/java/org/flowable/osgi/BpmnURLHandler.java#L34-L70","documentation":"The Flowable OSGi BPMN URL handler (bpmn:) requires the URL path to point at a BPMN XML resource. openConnection validates the path and throws MalformedURLException when it is null or blank, including the expected SYNTAX in the message. This guards the subsequent new URL(url.getPath()) construction from failing obscurely.","triggerScenarios":"Creating or resolving a bpmn: URL with a null/empty path, e.g. new URL(\"bpmn:\") or a path of only whitespace, triggering BpmnURLHandler.openConnection.","commonSituations":"Dynamically built bpmn: URLs where the resource path variable was never set; bundle manifests referencing BPMN resources without a location; copy-paste of URL schemes without the payload path.","solutions":["Provide the full path to the BPMN XML in the URL, e.g. bpmn:file:/path/to/process.bpmn20.xml","Validate the URL string before constructing java.net.URL","Check the source of the URL (manifest header, config) for missing resource locations"],"exampleFix":"// before\nURL url = new URL(\"bpmn:\" + resourcePath); // resourcePath was \"\"\n// after\nURL url = new URL(\"bpmn:\" + Optional.ofNullable(resourcePath).filter(p -> !p.trim().isEmpty()).orElseThrow(() -> new IllegalArgumentException(\"bpmn resource path required\")));","handlingStrategy":"validation","validationCode":"boolean validBpmnUrl(String u) {\n    if (u == null || !u.startsWith(\"bpmn:\")) return false;\n    String path = u.substring(5);\n    return path != null && !path.trim().isEmpty();\n}","typeGuard":null,"tryCatchPattern":"try {\n    URLConnection conn = new URL(bpmnUrl).openConnection();\n} catch (MalformedURLException e) {\n    throw new IllegalArgumentException(\"Invalid bpmn URL, expected \" + SYNTAX + \": \" + bpmnUrl, e);\n}","preventionTips":["Always include the BPMN XML path after the bpmn: scheme","Check bundle manifests for resource declarations that may resolve to empty paths"],"tags":["osgi","url","validation"],"backgroundTag":"invalid-url-format","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"}