{"record":{"id":"3ea463bfcd4198f4","repo":"pentaho/pentaho-kettle","slug":"jdbcdriverresolver-jar-not-found-jarabsolutepath","errorCode":null,"errorMessage":"JdbcDriverResolver: JAR not found: \" + jarAbsolutePath","messagePattern":"JdbcDriverResolver: JAR not found: \" \\+ jarAbsolutePath","errorType":"exception","errorClass":"KettleDatabaseException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/database/JdbcDriverResolver.java","lineNumber":399,"sourceCode":"    if ( path == null || path.trim().isEmpty() ) {\n      return false;\n    }\n    return Files.isRegularFile( Paths.get( path ) );\n  }\n\n  /**\n   * Converts an absolute JAR path to a {@link URL}, validating that the file exists\n   * and has a {@code .jar} extension.\n   *\n   * @param jarAbsolutePath absolute path to the JAR file\n   * @return the file URL\n   * @throws KettleDatabaseException if the file does not exist, is not a regular file,\n   *                                  does not end with .jar, or cannot be converted\n   */\n  private static URL toJarUrl( String jarAbsolutePath ) throws KettleDatabaseException {\n    File jarFile = new File( jarAbsolutePath );\n    if ( !jarFile.exists() || !jarFile.isFile() ) {\n      throw new KettleDatabaseException( \"JdbcDriverResolver: JAR not found: \" + jarAbsolutePath );\n    }\n    if ( !jarFile.getName().toLowerCase().endsWith( \".jar\" ) ) {\n      throw new KettleDatabaseException( \"JdbcDriverResolver: not a JAR file: \" + jarAbsolutePath );\n    }\n    try {\n      return jarFile.toPath().toUri().toURL();\n    } catch ( Exception e ) {\n      throw new KettleDatabaseException( \"JdbcDriverResolver: Cannot convert path to URL: \" + jarAbsolutePath, e );\n    }\n  }\n}\n","sourceCodeStart":381,"sourceCodeEnd":411,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/database/JdbcDriverResolver.java#L381-L411","documentation":"toJarUrl() converts an absolute JAR path into a file: URL for the classloader URL list (buildUrlList). It first verifies the file exists and is a regular file; if not, it throws this KettleDatabaseException naming the path.","triggerScenarios":"buildUrlList received a path produced earlier in the pipeline that no longer exists — e.g. the resolved JAR was deleted between resolve() and toJarUrl(), or a stale cached path points to a removed file.","commonSituations":"Driver cache directory cleaned between calls (temp dirs wiped); JAR deleted while Pentaho was running; path computed from a different mount point that is not mounted in the container.","solutions":["Confirm the path in the message exists on disk (ls the file)","Re-run the resolution so a missing JAR is re-downloaded or relocated","Restore/re-mount the volume holding the drivers directory","Check whether any cleanup job deletes files from the drivers/cache directory"],"exampleFix":"// before\nURL url = resolver.toJarUrl( previouslyResolvedPath ); // may be stale\n// after\nif ( new File( previouslyResolvedPath ).isFile() ) {\n  URL url = resolver.toJarUrl( previouslyResolvedPath );\n} else {\n  previouslyResolvedPath = JdbcDriverResolver.resolve( driverId );\n}","handlingStrategy":"validation","validationCode":"File jar = new File( jarAbsolutePath );\nif ( !jar.exists() || !jar.isFile() ) throw new IllegalStateException( \"JAR missing: \" + jarAbsolutePath );","typeGuard":"boolean isRegularJar( String p ) { File f = new File( p ); return f.isFile(); }","tryCatchPattern":"try { urls = buildUrlList( paths ); } catch ( KettleDatabaseException e ) { if ( e.getMessage().startsWith( \"JdbcDriverResolver: JAR not found\" ) ) { reResolveAndRetry(); } throw e; }","preventionTips":["Re-resolve paths close to use instead of caching them across restarts","Exclude driver directories from cleanup jobs","Mount persistent volumes for drivers in containers"],"tags":["file-not-found","jdbc","driver"],"backgroundTag":"file-not-found","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}