pentaho/pentaho-kettle · error · InvocationTargetException

GetXMLDateLoopNodesImportProgressDialog.Exception.ErrorScann…

Error message

GetXMLDateLoopNodesImportProgressDialog.Exception.ErrorScanningFile

What it means

Thrown (as an InvocationTargetException) by XMLInputFieldsImportProgressDialog.run when doScan fails while scanning an XML file to infer field definitions. Same pattern as the loop-nodes dialog: any exception is wrapped with the localized 'ErrorScanningFile' message containing the filename and e.toString().

Solutions

  1. Validate the named file is well-formed XML with an editor or xmllint
  2. Inspect the embedded cause string for the exact parser/XPath failure and fix the document
  3. Normalize encoding and re-export the sample file, then rerun the field import

Example fix

// before
xmllint --noout sample.xml  => parsing failure: premature end of data
// after
re-download/re-save complete sample.xml; xmllint passes
Defensive patterns

Strategy: validation

Validate before calling

// Validate the sample XML before the field-import scan
try (Reader r = Files.newBufferedReader(Paths.get(filename), StandardCharsets.UTF_8)) {
    DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(r));
} // parse throws => repair file first

Try / catch

try {
    progressDialog.open();
} catch (InvocationTargetException e) {
    log.error("Field scan failed for " + filename + ": " + e.getCause());
    // repair/re-export the XML file and rerun
}

Prevention

When it happens

Trigger: doScan throws while parsing/analyzing the sample file to extract fields: malformed XML, unreadable file, encoding problems, or XPath errors during field enumeration.

Common situations: Sample file is not well-formed XML; wrong encoding; file truncated mid-download; special namespaces confusing the XPath scan.

Related errors


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

Appendix: source

Thrown at plugins/xml/core/src/main/java/org/pentaho/di/ui/trans/steps/getxmldata/XMLInputFieldsImportProgressDialog.java:124

    this.list = new HashSet<String>();
    this.fieldsList = new ArrayList<RowMetaAndData>();
    if ( useUrl ) {
      this.xml = null;
      this.url = xmlSource;
    } else {
      this.xml = xmlSource;
      this.url = null;
    }
  }

  public RowMetaAndData[] open( Bowl bowl ) {
    IRunnableWithProgress op = new IRunnableWithProgress() {
      public void run( IProgressMonitor monitor ) throws InvocationTargetException, InterruptedException {
        try {
          fields = doScan( bowl, monitor );
        } catch ( Exception e ) {
          e.printStackTrace();
          throw new InvocationTargetException( e, BaseMessages.getString( PKG,
              "GetXMLDateLoopNodesImportProgressDialog.Exception.ErrorScanningFile", filename, e.toString() ) );
        }
      }
    };

    try {
      ProgressMonitorDialog pmd = new ProgressMonitorDialog( shell );
      pmd.run( true, true, op );
    } catch ( InvocationTargetException e ) {
      new ErrorDialog( shell, BaseMessages.getString( PKG,
          "GetXMLDateLoopNodesImportProgressDialog.ErrorScanningFile.Title" ), BaseMessages.getString( PKG,
          "GetXMLDateLoopNodesImportProgressDialog.ErrorScanningFile.Message" ), e );
    } catch ( InterruptedException e ) {
      new ErrorDialog( shell, BaseMessages.getString( PKG,
          "GetXMLDateLoopNodesImportProgressDialog.ErrorScanningFile.Title" ), BaseMessages.getString( PKG,
          "GetXMLDateLoopNodesImportProgressDialog.ErrorScanningFile.Message" ), e );
    }

View on GitHub (pinned to f3058517a1)