{"record":{"id":"c5e595c9b820d669","repo":"flowable/flowable-engine","slug":"bundle-cannot-be-generated","errorCode":null,"errorMessage":"Bundle cannot be generated","messagePattern":"Bundle cannot be generated","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/flowable-osgi/src/main/java/org/flowable/osgi/BarURLHandler.java","lineNumber":82,"sourceCode":"        public Connection(URL url) {\n            super(url);\n        }\n\n        @Override\n        public void connect() throws IOException {\n        }\n\n        @Override\n        public InputStream getInputStream() throws IOException {\n            final PipedInputStream pin = new PipedInputStream();\n            final PipedOutputStream pout = new PipedOutputStream(pin);\n            new Thread() {\n                @Override\n                public void run() {\n                    try {\n                        BarTransformer.transform(barXmlURL, pout);\n                    } catch (Exception e) {\n                        LOGGER.warn(\"Bundle cannot be generated\");\n                    } finally {\n                        try {\n                            pout.close();\n                        } catch (IOException ignore) {\n                            // if we get here something is very wrong\n                            LOGGER.error(\"Bundle cannot be generated\", ignore);\n                        }\n                    }\n                }\n            }.start();\n            return pin;\n        }\n    }\n\n}\n","sourceCodeStart":64,"sourceCodeEnd":98,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-osgi/src/main/java/org/flowable/osgi/BarURLHandler.java#L64-L98","documentation":"When a 'bar:' URL is opened, BarURLHandler streams a synthetic OSGi bundle generated from the BAR's bar-deployment.xml via BarTransformer.transform. If transformation throws for any reason, the writer thread logs 'Bundle cannot be generated' so the caller sees an empty/failed stream rather than a crash.","triggerScenarios":"Opening a bar: URL (BarURLHandler.run) where BarTransformer.transform(barXmlURL, pout) throws: malformed or missing bar-deployment.xml inside the BAR, unresolvable bundle imports declared in it, or IO errors writing the generated jar.","commonSituations":"A BAR archive built with invalid OSGi manifest instructions; bar-deployment.xml referencing packages unavailable in the target container; corrupted BAR file deployed through the bpmn/bar URL stream handler.","solutions":["Enable debug logging for the BarURLHandler/BarTransformer to see the suppressed exception cause.","Validate the BAR's bar-deployment.xml and the OSGi manifest instructions it generates (imports/exports must be resolvable).","Rebuild/repackage the BAR ensuring it is a valid zip containing bar-deployment.xml.","If only process deployment is needed, use a plain bpmn: deployment or deploy through RepositoryService.createDeployment() instead of the bar: URL."],"exampleFix":"// before: BAR without valid bar-deployment.xml\nmy-app.bar = [processes/*.bpmn20.xml]\n// after: include a valid bar-deployment.xml with resolvable imports\n<bar-deployment>\n  <bundle symbolicName=\"my.app\" version=\"1.0.0\"/>\n</bar-deployment>","handlingStrategy":"try-catch","validationCode":"try (ZipFile bar = new ZipFile(barFile)) {\n    if (bar.getEntry(\"bar-deployment.xml\") == null)\n        throw new IllegalArgumentException(\"BAR missing bar-deployment.xml\");\n}","typeGuard":null,"tryCatchPattern":"try (InputStream in = barUrl.openStream()) {\n    // consume generated bundle\n} catch (IOException e) {\n    logger.error(\"bar: bundle generation failed; check bar-deployment.xml\", e);\n}","preventionTips":["Validate BAR archives (zip integrity + bar-deployment.xml presence) before deploying.","Keep generated OSGi imports resolvable in the target container.","Enable debug logging on org.flowable.osgi to capture the suppressed cause."],"tags":["osgi","bar","bundle-generation","io"],"backgroundTag":"file-not-found","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"}