pentaho/pentaho-kettle · error · KettleStepException

XsdValidator.Exception.XMLfileMissing

Error message

XsdValidator.Exception.XMLfileMissing

What it means

Validation in XsdValidator.processRow: the XSD filename setting is empty while no XSD field supplies the schema, so the validator has no schema to validate against. Fires before the SchemaFactory parses anything.

Solutions

  1. Check the logged filename (XMLFieldvalue) and verify it exists on the executing machine
  2. Generate absolute paths upstream (e.g. using ${Internal.Transformation.Filename.Directory})
  3. Add a 'File exists' filter step before the validator to skip/handle missing files
  4. Fix case sensitivity or path separators in the data

Example fix

// before
String xmlPath = "data/orders/order1.xml"; // relative, run dir differs
// after
String xmlPath = "${Internal.Transformation.Filename.Directory}/data/orders/order1.xml";
Defensive patterns

Strategy: validation

Validate before calling

FileObject f = KettleVFS.getInstance(bowl).getFileObject(xmlPath);
if (f == null || !f.exists()) { skipOrRouteToErrorRow(xmlPath); }

Try / catch

try { run(); } catch (KettleStepException e) { if (e.getMessage().contains("XMLfileMissing")) { handleMissingFile(xmlPath); } else { throw e; } }

Prevention

When it happens

Trigger: Row value used as XML filename points to a missing/nonexistent file: KettleVFS getFileObject returns null or exists() false — bad path in the data, file deleted between listing and validating, env-specific path.

Common situations: File-listing feeds validator but files were archived/deleted; relative paths in data broken by different working directory; case-sensitive filesystems on Linux vs paths generated on Windows.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/bbb89b62cd8009b8. Report an issue: GitHub.

Appendix: source

Thrown at plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xsdvalidator/XsdValidator.java:202

        SchemaFactory factoryXSDValidator = SchemaFactory.newInstance( XMLConstants.W3C_XML_SCHEMA_NS_URI );
        factoryXSDValidator.setFeature(
          XMLConstants.FEATURE_SECURE_PROCESSING, true);
        factoryXSDValidator.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);

        xsdfile = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( xsdfilename, getTransMeta() );

        // Get XML stream
        Source sourceXML = new StreamSource( new StringReader( XMLFieldvalue ) );

        if ( meta.getXMLSourceFile() ) {

          // We deal with XML file
          // Get XML File
          FileObject xmlfileValidator = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( XMLFieldvalue );
          if ( xmlfileValidator == null || !xmlfileValidator.exists() ) {
            logError( BaseMessages.getString( PKG, "XsdValidator.Log.Error.XMLfileMissing", XMLFieldvalue ) );
            throw new KettleStepException( BaseMessages.getString( PKG, "XsdValidator.Exception.XMLfileMissing",
                XMLFieldvalue ) );
          }
          sourceXML = new StreamSource( xmlfileValidator.getContent().getInputStream() );
        }

        // create the schema
        Schema SchematXSD = null;
        if ( xsdfile instanceof AbstractFileObject ) {
          if ( xsdfile.getName().getURI().contains( "ram:///" ) ) {
            SchematXSD = factoryXSDValidator.newSchema( new StreamSource( xsdfile.getContent().getInputStream() ) );
          } else {
            SchematXSD = factoryXSDValidator.newSchema( new File( KettleVFS.getFilename( xsdfile ) ) );
          }
        } else {
          // we should not get here as anything entered in that does not look like
          // a url should be made a FileObject.
          throw new KettleStepException( BaseMessages.getString( PKG, "XsdValidator.Exception.CannotCreateSchema",
              xsdfile.getClass().getName() ) );

View on GitHub (pinned to f3058517a1)