{"record":{"id":"862c8582ee0edeb6","repo":"apache/seatunnel","slug":"the-uri-of-jar-illegal-s","errorCode":null,"errorMessage":"the uri of jar illegal:%s","messagePattern":"the uri of jar illegal:(.+?)","errorType":"exception","errorClass":"SeaTunnelEngineException","httpStatus":null,"severity":"error","filePath":"seatunnel-engine/seatunnel-engine-core/src/main/java/org/apache/seatunnel/engine/core/parse/JobPluginClasspathHelper.java","lineNumber":64,"sourceCode":"\n    /**\n     * Third-party JAR URLs declared in {@code env} ({@link EnvCommonOptions#JARS}), same as {@link\n     * MultipleTableJobConfigParser#fillJobConfigAndCommonJars()} appends to common plugin jars.\n     *\n     * @param envOptions the env section of the job config as a {@link ReadonlyConfig}\n     * @return list of resolved third-party JAR URLs (may be empty)\n     */\n    public static List<URL> thirdPartyJarsFromEnv(ReadonlyConfig envOptions) {\n        String jarsOption = envOptions.getOptional(EnvCommonOptions.JARS).orElse(\"\");\n        return new ArrayList<>(\n                Common.getThirdPartyJars(jarsOption).stream()\n                        .map(Path::toUri)\n                        .map(\n                                uri -> {\n                                    try {\n                                        return uri.toURL();\n                                    } catch (MalformedURLException e) {\n                                        throw new SeaTunnelEngineException(\n                                                \"the uri of jar illegal:\" + uri, e);\n                                    }\n                                })\n                        .collect(Collectors.toList()));\n    }\n\n    /**\n     * Connector JAR URLs for the given plugin configs, plus {@code commonPluginJars}, matching the\n     * discovery rules used when building the pipeline:\n     *\n     * <ul>\n     *   <li>SOURCE – {@link SeaTunnelSourcePluginDiscovery#getPluginJarAndDependencyPaths}\n     *   <li>TRANSFORM – {@link SeaTunnelTransformPluginDiscovery#getPluginJarPaths}\n     *   <li>SINK – {@link SeaTunnelSinkPluginDiscovery#getPluginJarAndDependencyPaths}\n     * </ul>\n     *\n     * @param configs list of raw plugin {@link Config} blocks\n     * @param type the plugin type (SOURCE, TRANSFORM, or SINK)","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-core/src/main/java/org/apache/seatunnel/engine/core/parse/JobPluginClasspathHelper.java#L46-L82","documentation":"thirdPartyJarsFromEnv converts jar URIs from the SeaTunnel env configuration into URLs. If a URI is malformed (uri.toURL throws MalformedURLException), it is wrapped in a SeaTunnelEngineException with 'the uri of jar illegal: <uri>'. This catches invalid jar path entries in env-level classpath configuration.","triggerScenarios":"Env config jar uris (e.g. seaTunnel jar dir / jar urls list) contain entries that cannot be converted to a valid URL — unsupported scheme, illegal characters like spaces or unescaped brackets, or a relative/garbage path.","commonSituations":"Jar paths with spaces or non-ASCII characters; missing protocol on a remote uri; pasted 'file://' with wrong number of slashes; Windows-style paths used on Linux; placeholder values not replaced in templates.","solutions":["Fix the jar uri in the env config so it is a valid absolute URL (e.g. file:///path/to/connector.jar)","Percent-encode spaces and special characters in the path, or move jars to a path without them","Use an absolute path for file-based jars","Print/log each uri in the env jar list and validate with new URI(...).toURL() before submitting the job"],"exampleFix":"// before\nenv {\n  jar.urls = [\"/opt/my connectors/app.jar\"]\n}\n// after\nenv {\n  jar.urls = [\"file:///opt/my-connectors/app.jar\"]\n}","handlingStrategy":"validation","validationCode":"for (String jarUri : jarUris) {\n    try {\n        new URI(jarUri).toURL();\n    } catch (URISyntaxException | MalformedURLException | IllegalArgumentException e) {\n        throw new IllegalArgumentException(\"Illegal jar uri: \" + jarUri, e);\n    }\n}","typeGuard":"static boolean isValidJarUri(String uri) {\n    try { new URI(uri).toURL(); return true; }\n    catch (Exception e) { return false; }\n}","tryCatchPattern":"try {\n    helper.thirdPartyJarsFromEnv(envOptions);\n} catch (SeaTunnelEngineException e) {\n    log.error(\"Invalid jar uri in env config: {}\", e.getMessage());\n    throw e;\n}","preventionTips":["Use absolute file:// URLs for jars","Avoid spaces and special characters in jar paths","Validate env jar list before job submission","Replace template placeholders with real paths"],"tags":["java","classpath","url","env-config"],"backgroundTag":"invalid-url-format","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"}