{"record":{"id":"459df92f5679be45","repo":"pentaho/pentaho-kettle","slug":"getxmldateloopnodesimportprogressdialog-exception-459df9","errorCode":null,"errorMessage":"GetXMLDateLoopNodesImportProgressDialog.Exception.ErrorScanningFile","messagePattern":"GetXMLDateLoopNodesImportProgressDialog\\.Exception\\.ErrorScanningFile","errorType":"exception","errorClass":"InvocationTargetException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/ui/trans/steps/getxmldata/XMLInputFieldsImportProgressDialog.java","lineNumber":124,"sourceCode":"    this.list = new HashSet<String>();\n    this.fieldsList = new ArrayList<RowMetaAndData>();\n    if ( useUrl ) {\n      this.xml = null;\n      this.url = xmlSource;\n    } else {\n      this.xml = xmlSource;\n      this.url = null;\n    }\n  }\n\n  public RowMetaAndData[] open( Bowl bowl ) {\n    IRunnableWithProgress op = new IRunnableWithProgress() {\n      public void run( IProgressMonitor monitor ) throws InvocationTargetException, InterruptedException {\n        try {\n          fields = doScan( bowl, monitor );\n        } catch ( Exception e ) {\n          e.printStackTrace();\n          throw new InvocationTargetException( e, BaseMessages.getString( PKG,\n              \"GetXMLDateLoopNodesImportProgressDialog.Exception.ErrorScanningFile\", filename, e.toString() ) );\n        }\n      }\n    };\n\n    try {\n      ProgressMonitorDialog pmd = new ProgressMonitorDialog( shell );\n      pmd.run( true, true, op );\n    } catch ( InvocationTargetException e ) {\n      new ErrorDialog( shell, BaseMessages.getString( PKG,\n          \"GetXMLDateLoopNodesImportProgressDialog.ErrorScanningFile.Title\" ), BaseMessages.getString( PKG,\n          \"GetXMLDateLoopNodesImportProgressDialog.ErrorScanningFile.Message\" ), e );\n    } catch ( InterruptedException e ) {\n      new ErrorDialog( shell, BaseMessages.getString( PKG,\n          \"GetXMLDateLoopNodesImportProgressDialog.ErrorScanningFile.Title\" ), BaseMessages.getString( PKG,\n          \"GetXMLDateLoopNodesImportProgressDialog.ErrorScanningFile.Message\" ), e );\n    }\n","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/ui/trans/steps/getxmldata/XMLInputFieldsImportProgressDialog.java#L106-L142","documentation":"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().","triggerScenarios":"doScan throws while parsing/analyzing the sample file to extract fields: malformed XML, unreadable file, encoding problems, or XPath errors during field enumeration.","commonSituations":"Sample file is not well-formed XML; wrong encoding; file truncated mid-download; special namespaces confusing the XPath scan.","solutions":["Validate the named file is well-formed XML with an editor or xmllint","Inspect the embedded cause string for the exact parser/XPath failure and fix the document","Normalize encoding and re-export the sample file, then rerun the field import"],"exampleFix":"// before\nxmllint --noout sample.xml  => parsing failure: premature end of data\n// after\nre-download/re-save complete sample.xml; xmllint passes","handlingStrategy":"validation","validationCode":"// Validate the sample XML before the field-import scan\ntry (Reader r = Files.newBufferedReader(Paths.get(filename), StandardCharsets.UTF_8)) {\n    DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(r));\n} // parse throws => repair file first","typeGuard":null,"tryCatchPattern":"try {\n    progressDialog.open();\n} catch (InvocationTargetException e) {\n    log.error(\"Field scan failed for \" + filename + \": \" + e.getCause());\n    // repair/re-export the XML file and rerun\n}","preventionTips":["Ensure sample files are complete (no truncated downloads)","Validate XML well-formedness before using import dialogs","Declare and consistent-use namespaces in sample documents"],"tags":["kettle","dialog","xml","fields-scan"],"backgroundTag":"xml-parse-error","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"}