{"record":{"id":"38021ca1f07352c3","repo":"pentaho/pentaho-kettle","slug":"xmlhandler-filedoesnotexists","errorCode":"XMLHandler.FileDoesNotExists","errorMessage":"${XMLHandler.FileDoesNotExists}","messagePattern":"\\$\\{XMLHandler\\.FileDoesNotExists\\}","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/xml/XMLHandler.java","lineNumber":618,"sourceCode":"        try {\n          return loadXMLFile( KettleVFS.getInputStream( fileObject ), systemID, ignoreEntities, namespaceAware );\n        } catch ( Exception ex ) {\n          lastException = ex;\n          try {\n            java.lang.Thread.sleep( 1000 );\n          } catch ( InterruptedException e ) {\n            //Sonar squid S2142 requires the handling of the InterruptedException instead of ignoring it\n            Thread.currentThread().interrupt();\n          }\n        }\n        attempts++;\n      }\n\n      throw new KettleXMLException( BaseMessages.getString(\n        PKG, \"XMLHandler.errorReadingFile\", fileObject.toString() ), lastException );\n    }\n\n    throw new KettleXMLException( BaseMessages.getString(\n      PKG, \"XMLHandler.FileDoesNotExists\", fileObject.toString() ) );\n  }\n\n  /**\n   * Read in an XML file from the passed input stream and return an XML document\n   *\n   * @param inputStream The filename input stream to read the document from\n   * @return the Document if all went well, null if an error occurred!\n   */\n  public static Document loadXMLFile( InputStream inputStream ) throws KettleXMLException {\n    return loadXMLFile( inputStream, null, false, false );\n  }\n\n  /**\n   * Load a file into an XML document\n   *\n   * @param inputStream    The stream to load a document from\n   * @param systemID       Provide a base for resolving relative URIs.","sourceCodeStart":600,"sourceCodeEnd":636,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/xml/XMLHandler.java#L600-L636","documentation":"loadXMLFile throws this KettleXMLException when the supplied file (a KettleVFS FileObject) does not exist on disk. The library checks existence before attempting XML parsing and fails fast with a localized message that includes the file path. It signals a path/configuration problem, not a parse problem.","triggerScenarios":"Calling XMLHandler.loadXMLFile(FileObject) with a fileObject where fileObject.exists() returns false (or is not a file). The message is filled with fileObject.toString().","commonSituations":"Typos in kettle.properties-referenced file paths, relative paths resolved against the wrong working directory, files deleted between check and load, deploying jobs/transformation resources that reference missing XML files, case-sensitive filesystems on Linux.","solutions":["Verify the file path exists before calling loadXMLFile (new File(path).exists() or FileObject.exists()).","Convert relative paths to absolute against $PWD or KETTLE_HOME; on Linux check case sensitivity.","Ensure the resource file is deployed/packaged alongside the job or transformation.","If loading from the classpath instead, use loadXMLFile(InputStream) or loadXMLFile(URL)."],"exampleFix":"// before\nDocument doc = XMLHandler.loadXMLFile(KettleVFS.getFileObject(\"conf/job.xml\"));\n// after\nFileObject fo = KettleVFS.getFileObject(\"conf/job.xml\");\nif (fo == null || !fo.exists() || !fo.isFile()) {\n  throw new KettleException(\"Missing XML file: \" + fo);\n}\nDocument doc = XMLHandler.loadXMLFile(fo);","handlingStrategy":"validation","validationCode":"FileObject fo = KettleVFS.getFileObject(path);\nif (fo == null || !fo.exists() || !fo.isFile()) {\n  throw new KettleException(\"XML file missing: \" + path);\n}","typeGuard":"boolean isLoadable(FileObject fo) {\n  try { return fo != null && fo.exists() && fo.isFile(); }\n  catch (FileSystemException e) { return false; }\n}","tryCatchPattern":"try {\n  Document doc = XMLHandler.loadXMLFile(fo);\n} catch (KettleXMLException e) {\n  throw new KettleException(\"Config XML not found: \" + fo, e);\n}","preventionTips":["Resolve paths to absolute form and log them at startup","Ship required XML files with the deployment artifact","Remember Linux filesystems are case-sensitive"],"tags":["xml","file-not-found","vfs"],"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"}