{"record":{"id":"497cc27c96eea29e","repo":"pentaho/pentaho-kettle","slug":"xsdvalidator-exception-errorxsdfilemissing","errorCode":null,"errorMessage":"XsdValidator.Exception.ErrorXSDFileMissing","messagePattern":"XsdValidator\\.Exception\\.ErrorXSDFileMissing","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xsdvalidator/XsdValidator.java","lineNumber":110,"sourceCode":"          // The field is unreachable !\n          logError( BaseMessages.getString( PKG, \"XsdValidator.Log.ErrorFindingField\" ) + \"[\" + meta.getXMLStream()\n              + \"]\" );\n          throw new KettleStepException( BaseMessages.getString( PKG, \"XsdValidator.Exception.CouldnotFindField\", meta\n              .getXMLStream() ) );\n        }\n\n        // Let's check that Result Field is given\n        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                }","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xsdvalidator/XsdValidator.java#L92-L128","documentation":"KettleStepException thrown by the XsdValidator step at transform start when the XSD source is 'Specify Filename' but no XSD filename was configured in the step metadata. The step cannot validate XML without a schema, so it fails fast in processRow.","triggerScenarios":"Step meta has XSDSource == SPECIFY_FILENAME while getXSDFilename() returns null (field left blank or not saved in the transformation XML/repository).","commonSituations":"Cloning/shared step where the filename field was never filled; transformation edited by hand or by a metadata generator that omitted the attribute; upgrade/import losing step settings.","solutions":["Open the XsdValidator step dialog and set the XSD filename in the 'Specify filename' source mode","Or switch 'XSD source' to another mode (field or no need for schema)","Verify the saved ktr XML contains the xsd filename attribute for the step","Null-check meta.getXSDFilename() before executing the transformation programmatically"],"exampleFix":"// before\nmeta.setXSDSource(meta.SPECIFY_FILENAME);\n// after\nmeta.setXSDSource(meta.SPECIFY_FILENAME);\nif (meta.getXSDFilename() == null) { meta.setXSDFilename(\"/schemas/order.xsd\"); }","handlingStrategy":"validation","validationCode":"if (meta.getXSDSource().equals(meta.SPECIFY_FILENAME) && meta.getXSDFilename() == null) { throw new IllegalArgumentException(\"XSD filename must be set when XSD source = filename\"); }","typeGuard":null,"tryCatchPattern":"try { trans.execute(...); } catch (KettleException e) { if (e.getMessage().contains(\"ErrorXSDFileMissing\")) { /* fix step config */ } else { throw e; } }","preventionTips":["Always fill the XSD filename when choosing 'Specify filename' mode","Validate step metadata in CI by loading the ktr and asserting required fields","Use transformation metadata templates that include schema paths"],"tags":["kettle","xsd-validator","missing-config","xsd-filename"],"backgroundTag":"missing-required-config-field","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"}