{"record":{"id":"5dd16b8e1c53180a","repo":"apache/seatunnel","slug":"the-uri-of-jar-illegal-uri","errorCode":null,"errorMessage":"the uri of jar illegal:${uri}","messagePattern":"the uri of jar illegal:(.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-core/seatunnel-flink-starter/seatunnel-flink-starter-common/src/main/java/org/apache/seatunnel/core/starter/flink/execution/FlinkExecution.java","lineNumber":189,"sourceCode":"\n    private void registerPlugin(Config envConfig) {\n        List<Path> thirdPartyJars = new ArrayList<>();\n        if (envConfig.hasPath(EnvCommonOptions.JARS.key())) {\n            thirdPartyJars =\n                    new ArrayList<>(\n                            Common.getThirdPartyJars(\n                                    envConfig.getString(EnvCommonOptions.JARS.key())));\n        }\n        thirdPartyJars.addAll(Common.getPluginsJarDependenciesWithoutConnectorDependency());\n        List<URL> jarDependencies =\n                Stream.concat(thirdPartyJars.stream(), Common.getLibJars().stream())\n                        .map(Path::toUri)\n                        .map(\n                                uri -> {\n                                    try {\n                                        return uri.toURL();\n                                    } catch (MalformedURLException e) {\n                                        throw new RuntimeException(\n                                                \"the uri of jar illegal:\" + uri, e);\n                                    }\n                                })\n                        .collect(Collectors.toList());\n        FlinkAbstractPluginExecuteProcessor.ADD_URL_TO_CLASSLOADER.accept(\n                Thread.currentThread().getContextClassLoader(), jarDependencies);\n        jarPaths.addAll(jarDependencies);\n    }\n\n    private Config registerPlugin(Config config, Collection<URL> jars) {\n        config =\n                this.injectJarsToConfig(\n                        config, ConfigUtil.joinPath(\"env\", \"pipeline\", \"jars\"), jars);\n        return this.injectJarsToConfig(\n                config, ConfigUtil.joinPath(\"env\", \"pipeline\", \"classpaths\"), jars);\n    }\n\n    private Config injectJarsToConfig(Config config, String path, Collection<URL> jars) {","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-core/seatunnel-flink-starter/seatunnel-flink-starter-common/src/main/java/org/apache/seatunnel/core/starter/flink/execution/FlinkExecution.java#L171-L207","documentation":"FlinkExecution.registerPlugin resolves local jar paths from env 'jars' into URIs and converts each to a URL for the classloader; a URI that cannot be converted to a URL triggers a RuntimeException 'the uri of jar illegal:<uri>'.","triggerScenarios":"env config lists jars entries whose Path.toUri().toURL() fails due to malformed or non-absolute paths, e.g. relative paths or paths with characters that make the URI unresolvable.","commonSituations":"Relative jar paths in env.jars (should be absolute); jars directory moved or deleted; spaces or special characters in the SeaTunnel install path.","solutions":["Use absolute paths for every entry in env.jars","Verify each jar file exists at the given path before starting the job","Move SeaTunnel/Flink installations to a path without spaces or special characters","Check that the paths are proper file URIs (file:/...) not raw malformed strings"],"exampleFix":"// before\nenv {\n  jars = \"connector/mysql-connector.jar\"\n}\n// after\nenv {\n  jars = \"/opt/seatunnel/connectors/mysql-connector.jar\"\n}","handlingStrategy":"validation","validationCode":"for (String jar : jars.split(\";\")) {\n    Path p = java.nio.file.Paths.get(jar);\n    if (!p.isAbsolute() || !java.nio.file.Files.exists(p)) {\n        throw new IllegalArgumentException(\"Invalid jar path: \" + jar);\n    }\n}","typeGuard":"boolean isValidJarUri(Path p) {\n    try { p.toUri().toURL(); return true; } catch (Exception e) { return false; }\n}","tryCatchPattern":"try {\n    registerPlugin(envConfig);\n} catch (RuntimeException e) {\n    if (e.getMessage().startsWith(\"the uri of jar illegal\")) {\n        log.error(\"Fix env.jars entries to absolute, valid paths\", e);\n    }\n}","preventionTips":["Use absolute paths in env.jars","Keep SeaTunnel installs in paths without spaces","Pre-check jar existence before job launch"],"tags":["flink","classpath","jar-url","env-config"],"backgroundTag":"invalid-url","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}