{"record":{"id":"4d4aa1fa38b54c01","repo":"pentaho/pentaho-kettle","slug":"xsdvalidator-exception-xsdfilenotexists","errorCode":null,"errorMessage":"XsdValidator.Exception.XSDFileNotExists","messagePattern":"XsdValidator\\.Exception\\.XSDFileNotExists","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xsdvalidator/XsdValidator.java","lineNumber":118,"sourceCode":"        if ( meta.getResultfieldname() == null ) {\n          // Result field is missing !\n          logError( BaseMessages.getString( PKG, \"XsdValidator.Log.ErrorResultFieldMissing\" ) );\n          throw new KettleStepException( BaseMessages.getString( PKG, \"XsdValidator.Exception.ErrorResultFieldMissing\" ) );\n        }\n\n        // Is XSD file is provided?\n        if ( meta.getXSDSource().equals( meta.SPECIFY_FILENAME ) ) {\n          if ( meta.getXSDFilename() == null ) {\n            logError( BaseMessages.getString( PKG, \"XsdValidator.Log.ErrorXSDFileMissing\" ) );\n            throw new KettleStepException( BaseMessages.getString( PKG, \"XsdValidator.Exception.ErrorXSDFileMissing\" ) );\n          } else {\n            // Is XSD file exists ?\n            FileObject xsdfile = null;\n            try {\n              xsdfile = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( environmentSubstitute( meta.getXSDFilename() ), getTransMeta() );\n              if ( !xsdfile.exists() ) {\n                logError( BaseMessages.getString( PKG, \"XsdValidator.Log.Error.XSDFileNotExists\" ) );\n                throw new KettleStepException( BaseMessages.getString( PKG, \"XsdValidator.Exception.XSDFileNotExists\" ) );\n              }\n\n            } catch ( Exception e ) {\n              logError( BaseMessages.getString( PKG, \"XsdValidator.Log.Error.GettingXSDFile\" ) );\n              throw new KettleStepException( BaseMessages.getString( PKG, \"XsdValidator.Exception.GettingXSDFile\" ) );\n            } finally {\n              try {\n                if ( xsdfile != null ) {\n                  xsdfile.close();\n                }\n              } catch ( IOException e ) {\n                // Ignore errors\n              }\n            }\n          }\n        }\n\n        // Is XSD field is provided?","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xsdvalidator/XsdValidator.java#L100-L136","documentation":"KettleStepException thrown when the configured XSD filename resolves to a file that does not exist on the filesystem/VFS. The step checks xsdfile.exists() right after resolving the (environment-substituted) filename and aborts the row loop.","triggerScenarios":"KettleVFS.getFileObject(environmentSubstitute(meta.getXSDFilename())) returns a FileObject whose exists() is false — path typo, missing env variable substitution producing a bad path, or schema file deleted/moved.","commonSituations":"Schema lives only on a developer machine; relative path wrong because transformation run from a different working directory (e.g. in Carte/pan); ${INTERNAL_...} or custom env variable unset so the path becomes empty or wrong.","solutions":["Verify the XSD file exists at the exact configured path on the machine running the transformation","Check environment variables used in the filename resolve correctly (log environmentSubstitute output)","Use an absolute path or correct the working directory when running via pan/Carte","Add the schema to source control / shared storage and reference it with a stable path"],"exampleFix":"// before\nString xsdPath = \"${XSD_HOME}/order.xsd\"; // XSD_HOME unset -> bad path\n// after\nString xsdPath = \"/opt/pdi/schemas/order.xsd\"; // or ensure XSD_HOME is exported","handlingStrategy":"validation","validationCode":"String path = environmentSubstitute(meta.getXSDFilename());\nif (path != null && !new File(path).exists()) { throw new IllegalStateException(\"XSD file not found: \" + path); }","typeGuard":null,"tryCatchPattern":"try { run(); } catch (KettleStepException e) { if (e.getMessage().contains(\"XSDFileNotExists\")) { checkSchemaDeployment(); } else { throw e; } }","preventionTips":["Deploy schema files with the transformation package","Use absolute or ${Internal...} variable-based paths","Verify paths on the actual execution host (pan/Carte), not just the design machine"],"tags":["kettle","xsd-validator","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"}