{"record":{"id":"4fa13cd16ac27bc4","repo":"pentaho/pentaho-kettle","slug":"xslt-exception-errorxslfilenotexists","errorCode":null,"errorMessage":"Xslt.Exception.ErrorXSLFileNotExists","messagePattern":"Xslt\\.Exception\\.ErrorXSLFileNotExists","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xslt/Xslt.java","lineNumber":137,"sourceCode":"              + \"]\" );\n          throw new KettleStepException( BaseMessages.getString( PKG, \"Xslt.Exception.ErrorXSLFileFieldFinding\", meta\n              .getXSLFileField() ) );\n        }\n\n      } else {\n        if ( Utils.isEmpty( meta.getXslFilename() ) ) {\n          logError( BaseMessages.getString( PKG, \"Xslt.Log.ErrorXSLFile\" ) );\n          throw new KettleStepException( BaseMessages.getString( PKG, \"Xslt.Exception.ErrorXSLFile\" ) );\n        }\n\n        // Check if XSL File exists!\n        data.xslfilename = environmentSubstitute( meta.getXslFilename() );\n        FileObject file = null;\n        try {\n          file = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( data.xslfilename );\n          if ( !file.exists() ) {\n            logError( BaseMessages.getString( PKG, \"Xslt.Log.ErrorXSLFileNotExists\", data.xslfilename ) );\n            throw new KettleStepException( BaseMessages.getString( PKG, \"Xslt.Exception.ErrorXSLFileNotExists\",\n                data.xslfilename ) );\n          }\n          if ( file.getType() != FileType.FILE ) {\n            logError( BaseMessages.getString( PKG, \"Xslt.Log.ErrorXSLNotAFile\", data.xslfilename ) );\n            throw new KettleStepException( BaseMessages.getString( PKG, \"Xslt.Exception.ErrorXSLNotAFile\",\n                data.xslfilename ) );\n          }\n        } catch ( Exception e ) {\n          throw new KettleStepException( e );\n        } finally {\n          try {\n            if ( file != null ) {\n              file.close();\n            }\n          } catch ( Exception e ) { /* Ignore */\n          }\n        }\n      }","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xslt/Xslt.java#L119-L155","documentation":"The configured XSL stylesheet file does not exist on the filesystem. processRow resolves the filename with environment substitution, obtains a VFS FileObject via KettleVFS, and if !file.exists() logs 'ErrorXSLFileNotExists' and throws this KettleStepException containing the resolved path.","triggerScenarios":"processRow's one-time setup: KettleVFS.getFileObject(data.xslfilename).exists() returns false for the environment-substituted XSL filename.","commonSituations":"Typo in the path; file deployed only on the designer machine but not the execution server/agent; relative path resolved against a different working directory; variable like ${XSL_FILE} unset so path becomes literal or empty; file deleted or renamed after configuration.","solutions":["Verify the resolved path exists on the machine executing the transformation (note environment substitution of variables).","Use an absolute path or ${Internal.Transformation.Filename.Directory} to anchor the stylesheet relative to the .ktr.","Copy the XSL file to the execution server if running on a cluster/remote agent.","Check the variable value with a 'Get variables' step or Spoon's variable viewer."],"exampleFix":"// before\nXSL filename: transform.xsl  // relative, missing on server\n// after\nXSL filename: ${Internal.Transformation.Filename.Directory}/transform.xsl","handlingStrategy":"validation","validationCode":"String path = transMeta.environmentSubstitute(meta.getXslFilename()); java.io.File f = new java.io.File(path); if (!f.exists() || !f.isFile()) { throw new IllegalStateException(\"XSL file does not exist: \" + path); } // before execution","typeGuard":null,"tryCatchPattern":"try { step.startThreads(); } catch (KettleStepException e) { if (e.getMessage().contains(\"ErrorXSLFileNotExists\")) { /* check resolved path on the executing host */ } }","preventionTips":["Deploy XSL files alongside the .ktr to all execution nodes","Use absolute paths or ${Internal.Transformation.Filename.Directory}","Log the environment-substituted path during setup to debug variable issues","Check file existence in a pre-run job step (Check if file exists)"],"tags":["xslt","file-not-found","kettle","vfs","path"],"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"}