{"record":{"id":"bbb89b62cd8009b8","repo":"pentaho/pentaho-kettle","slug":"xsdvalidator-exception-xmlfilemissing","errorCode":null,"errorMessage":"XsdValidator.Exception.XMLfileMissing","messagePattern":"XsdValidator\\.Exception\\.XMLfileMissing","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xsdvalidator/XsdValidator.java","lineNumber":202,"sourceCode":"\n        SchemaFactory factoryXSDValidator = SchemaFactory.newInstance( XMLConstants.W3C_XML_SCHEMA_NS_URI );\n        factoryXSDValidator.setFeature(\n          XMLConstants.FEATURE_SECURE_PROCESSING, true);\n        factoryXSDValidator.setFeature(\"http://apache.org/xml/features/disallow-doctype-decl\", true);\n\n        xsdfile = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( xsdfilename, getTransMeta() );\n\n        // Get XML stream\n        Source sourceXML = new StreamSource( new StringReader( XMLFieldvalue ) );\n\n        if ( meta.getXMLSourceFile() ) {\n\n          // We deal with XML file\n          // Get XML File\n          FileObject xmlfileValidator = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( XMLFieldvalue );\n          if ( xmlfileValidator == null || !xmlfileValidator.exists() ) {\n            logError( BaseMessages.getString( PKG, \"XsdValidator.Log.Error.XMLfileMissing\", XMLFieldvalue ) );\n            throw new KettleStepException( BaseMessages.getString( PKG, \"XsdValidator.Exception.XMLfileMissing\",\n                XMLFieldvalue ) );\n          }\n          sourceXML = new StreamSource( xmlfileValidator.getContent().getInputStream() );\n        }\n\n        // create the schema\n        Schema SchematXSD = null;\n        if ( xsdfile instanceof AbstractFileObject ) {\n          if ( xsdfile.getName().getURI().contains( \"ram:///\" ) ) {\n            SchematXSD = factoryXSDValidator.newSchema( new StreamSource( xsdfile.getContent().getInputStream() ) );\n          } else {\n            SchematXSD = factoryXSDValidator.newSchema( new File( KettleVFS.getFilename( xsdfile ) ) );\n          }\n        } else {\n          // we should not get here as anything entered in that does not look like\n          // a url should be made a FileObject.\n          throw new KettleStepException( BaseMessages.getString( PKG, \"XsdValidator.Exception.CannotCreateSchema\",\n              xsdfile.getClass().getName() ) );","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xsdvalidator/XsdValidator.java#L184-L220","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the logged filename (XMLFieldvalue) and verify it exists on the executing machine","Generate absolute paths upstream (e.g. using ${Internal.Transformation.Filename.Directory})","Add a 'File exists' filter step before the validator to skip/handle missing files","Fix case sensitivity or path separators in the data"],"exampleFix":"// before\nString xmlPath = \"data/orders/order1.xml\"; // relative, run dir differs\n// after\nString xmlPath = \"${Internal.Transformation.Filename.Directory}/data/orders/order1.xml\";","handlingStrategy":"validation","validationCode":"FileObject f = KettleVFS.getInstance(bowl).getFileObject(xmlPath);\nif (f == null || !f.exists()) { skipOrRouteToErrorRow(xmlPath); }","typeGuard":null,"tryCatchPattern":"try { run(); } catch (KettleStepException e) { if (e.getMessage().contains(\"XMLfileMissing\")) { handleMissingFile(xmlPath); } else { throw e; } }","preventionTips":["Filter file lists for existence before validating","Use absolute, platform-consistent paths in data","Watch for case sensitivity when moving from Windows to Linux"],"tags":["kettle","xsd-validator","file-not-found","xml-file"],"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"}