{"record":{"id":"a3e70240442d8945","repo":"pentaho/pentaho-kettle","slug":"xsdvalidator-exception-gettingxsdfile","errorCode":null,"errorMessage":"XsdValidator.Exception.GettingXSDFile","messagePattern":"XsdValidator\\.Exception\\.GettingXSDFile","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xsdvalidator/XsdValidator.java","lineNumber":123,"sourceCode":"\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?\n        if ( meta.getXSDSource().equals( meta.SPECIFY_FIELDNAME ) ) {\n          if ( meta.getXSDDefinedField() == null ) {\n            logError( BaseMessages.getString( PKG, \"XsdValidator.Log.Error.XSDFieldMissing\" ) );\n            throw new KettleStepException( BaseMessages.getString( PKG, \"XsdValidator.Exception.XSDFieldMissing\" ) );\n          } else {","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xsdvalidator/XsdValidator.java#L105-L141","documentation":"KettleStepException thrown when any Exception occurs while obtaining the XSD FileObject via KettleVFS (the catch block around getFileObject/exists). It masks the underlying cause (e.g. malformed URI, VFS provider failure, permission error).","triggerScenarios":"KettleVFS.getInstance(...).getFileObject(...) throws — invalid URI syntax (unescaped spaces/special chars), unsupported VFS scheme, network share unreachable, or security/IO exception resolving the path.","commonSituations":"Filenames with spaces or non-ASCII characters not URL-encoded; s3/ftp/http VFS endpoints misconfigured; SMB/network drive not mounted on the agent running the transformation.","solutions":["Check the log line 'XsdValidator.Log.Error.GettingXSDFile' context and the wrapped cause for the real VFS error","URL-encode special characters in the filename or simplify the path","Confirm the VFS scheme/provider is available and credentials are valid","Copy the XSD to a local path to isolate VFS/network issues"],"exampleFix":"// before\nString xsd = \"smb://server/my schemas/order.xsd\"; // space breaks VFS uri\n// after\nString xsd = \"smb://server/my%20schemas/order.xsd\";","handlingStrategy":"try-catch","validationCode":"// Pre-check URI validity\nURI uri = new URI(path.replace(\" \", \"%20\")); // throws URISyntaxException before the step runs","typeGuard":null,"tryCatchPattern":"try { run(); } catch (KettleStepException e) { log(\"GettingXSDFile: inspect VFS cause\", e); throw new IOException(\"XSD fetch failed\", e.getCause()); }","preventionTips":["URL-encode spaces and special characters in VFS filenames","Test VFS schemes/credentials outside the transformation first","Keep schemas on local disk when possible"],"tags":["kettle","xsd-validator","vfs","io-exception"],"backgroundTag":"file-open-failed","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"}