{"record":{"id":"df5f37d75c9bc170","repo":"pentaho/pentaho-kettle","slug":"transmeta-exception-invalidxmlpath","errorCode":null,"errorMessage":"TransMeta.Exception.InvalidXMLPath","messagePattern":"TransMeta\\.Exception\\.InvalidXMLPath","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/TransMeta.java","lineNumber":3078,"sourceCode":"    this.metaStore = metaStore;\n    this.repository = rep;\n\n    // OK, try to load using the VFS stuff...\n    Document doc = null;\n    try {\n      // start by inheriting the bowl from the argument. It might get overwritten later. \n      if ( bowl != null ) {\n        setBowl( bowl );\n      }\n      if ( parentVariableSpace == null ) {\n        parentVariableSpace = new Variables();\n        // load globals\n        parentVariableSpace.initializeVariablesFrom( null );\n      }\n\n      final FileObject transFile = KettleVFS.getInstance( bowl ).getFileObject( fname, parentVariableSpace );\n      if ( !transFile.exists() ) {\n        throw new KettleXMLException( BaseMessages.getString( PKG, \"TransMeta.Exception.InvalidXMLPath\", fname ) );\n      }\n      doc = XMLHandler.loadXMLFile( transFile );\n    } catch ( KettleXMLException ke ) {\n      // if we have a KettleXMLException, simply re-throw it\n      throw ke;\n    } catch ( KettleException | FileSystemException e ) {\n      throw new KettleXMLException( BaseMessages.getString(\n        PKG, \"TransMeta.Exception.ErrorOpeningOrValidatingTheXMLFile\", fname ), e );\n    }\n\n    if ( doc != null ) {\n      // Root node:\n      Node transnode = XMLHandler.getSubNode( doc, XML_TAG );\n\n      if ( transnode == null ) {\n        throw new KettleXMLException( BaseMessages.getString(\n          PKG, \"TransMeta.Exception.NotValidTransformationXML\", fname ) );\n      }","sourceCodeStart":3060,"sourceCodeEnd":3096,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/TransMeta.java#L3060-L3096","documentation":"A KettleXMLException (message key TransMeta.Exception.InvalidXMLPath, with fname substituted) thrown by the TransMeta constructor when the resolved VFS FileObject for fname does not exist. The path parsed fine as a URL/URI but no file is actually there.","triggerScenarios":"new TransMeta(bowl, fname, ...) where KettleVFS.getFileObject(fname, parentVariableSpace).exists() returns false — e.g., typo in path, variables in the path unresolved, file deleted.","commonSituations":"Relative paths evaluated against the wrong working directory; ${Internal...} or custom variables not set in parentVariableSpace; case-sensitive filesystem mismatches; moved/renamed .ktr files.","solutions":["Verify the file exists at the exact path (File f = new File(fname); f.exists()) before loading","Resolve all variables in the path and ensure parentVariableSpace has them set","Use absolute paths or anchor relative paths to a known base directory","Check filename case and extension on case-sensitive filesystems"],"exampleFix":"// before\nTransMeta tm = new TransMeta(bowl, \"${TRANS_HOME}/job.ktr\", metaStore, null, true, vars, null);\n// after\nvars.setVariable(\"TRANS_HOME\", \"/opt/etl/trans\");\nString resolved = vars.realVariableSpace-resolved path; // ensure variables set first\nTransMeta tm = new TransMeta(bowl, resolved, metaStore, null, true, vars, null);","handlingStrategy":"validation","validationCode":"org.apache.commons.vfs2.FileObject f = KettleVFS.getInstance(bowl).getFileObject(fname, vars);\nif (!f.exists()) throw new KettleException(\"Transformation not found: \" + fname);","typeGuard":null,"tryCatchPattern":"try { new TransMeta(bowl, fname, ...); } catch (KettleXMLException e) { log.error(\"Trans file not found at \" + fname, e); }","preventionTips":["Resolve all path variables before loading","Use absolute paths in deployment configs","Check file existence with the same VFS layer Kettle uses"],"tags":["kettle","transformation","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"}