{"record":{"id":"9d682b8dcfef5427","repo":"apache/pulsar","slug":"the-specified-jar-file-does-not-exist","errorCode":null,"errorMessage":"The specified jar file does not exist","messagePattern":"The specified jar file does not exist","errorType":"validation","errorClass":"ParameterException","httpStatus":null,"severity":"error","filePath":"pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java","lineNumber":732,"sourceCode":"                org.apache.pulsar.common.functions.Utils.inferMissingNamespace(functionConfig);\n            }\n\n            if (isNotBlank(functionConfig.getJar()) && isNotBlank(functionConfig.getPy())\n                    && isNotBlank(functionConfig.getGo())) {\n                throw new ParameterException(\"Either a Java jar or a Python file or a Go executable binary needs to\"\n                        + \" be specified for the function. Cannot specify both.\");\n            }\n\n            if (isBlank(functionConfig.getJar()) && isBlank(functionConfig.getPy())\n                    && isBlank(functionConfig.getGo())) {\n                throw new ParameterException(\"Either a Java jar or a Python file or a Go executable binary needs to\"\n                        + \" be specified for the function. Please specify one.\");\n            }\n\n            if (!isBlank(functionConfig.getJar()) && !functionConfig.getJar().startsWith(\"builtin://\")\n                    && !Utils.isFunctionPackageUrlSupported(functionConfig.getJar())\n                    && !new File(functionConfig.getJar()).exists()) {\n                throw new ParameterException(\"The specified jar file does not exist\");\n            }\n            if (!isBlank(functionConfig.getPy()) && !Utils.isFunctionPackageUrlSupported(functionConfig.getPy())\n                    && !new File(functionConfig.getPy()).exists()) {\n                throw new ParameterException(\"The specified python file does not exist\");\n            }\n            if (!isBlank(functionConfig.getGo()) && !Utils.isFunctionPackageUrlSupported(functionConfig.getGo())\n                    && !new File(functionConfig.getGo()).exists()) {\n                throw new ParameterException(\"The specified go executable binary does not exist\");\n            }\n        }\n    }\n\n    @Command(description = \"Run a Pulsar Function locally, rather than deploy to a Pulsar cluster)\")\n    class LocalRunner extends FunctionDetailsCommand {\n\n        // TODO: this should become BookKeeper URL and it should be fetched from Pulsar client.\n        // for backwards compatibility purposes\n        @Option(names = \"--stateStorageServiceUrl\", description = \"The URL for the state storage service \"","sourceCodeStart":714,"sourceCodeEnd":750,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java#L714-L750","documentation":"Thrown when the --jar value is a local filesystem path (not builtin:// and not a supported package URL) but no file exists at that path. The CLI validates artifact existence before submitting the function so failures surface early, before any admin request is sent.","triggerScenarios":"`pulsar-admin functions create/update/localrun` with --jar <path> where new File(path).exists() is false and the value is neither builtin:// nor a package-URL-supported location (CmdFunctions.java:732).","commonSituations":"Typos in the jar path; running the CLI from a different working directory with a relative path; artifact not built yet (mvn/gradle build skipped); CI workspace where the artifact was cleaned; path pointing to a file removed after a rebuild.","solutions":["Correct the --jar path or cd to the directory containing the jar","Build the jar first (e.g. mvn package) and point --jar at the produced artifact","Use an absolute path or a supported package URL (file:///http(s)://) instead of a fragile relative path","If the function is built-in, use --jar builtin://<function-name>"],"exampleFix":"// before\n--jar target/functions.jar   (file not built)\n// after\nmvn package && --jar /abs/path/target/functions.jar","handlingStrategy":"validation","validationCode":"String jar = config.getJar();\nif (jar != null && !jar.startsWith(\"builtin://\") && !Utils.isFunctionPackageUrlSupported(jar)\n        && !new File(jar).exists()) {\n    throw new IllegalStateException(\"jar does not exist: \" + jar);\n}","typeGuard":null,"tryCatchPattern":"try { admin.functions().createFunction(...); }\ncatch (ParameterException e) { if (e.getMessage().equals(\"The specified jar file does not exist\")) { log.error(\"Check --jar path: {}\", config.getJar()); } throw e; }","preventionTips":["Use absolute paths for artifacts in scripts and CI","Build the jar before invoking pulsar-admin (mvn package / gradle jar)","Verify the file exists (test -f) in shell wrappers before calling the CLI"],"tags":["cli","filesystem","pulsar-functions"],"backgroundTag":"file-not-found","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}