{"record":{"id":"9d09c397c810ed16","repo":"pentaho/pentaho-kettle","slug":"getxmldateloopnodesimportprogressdialog-exception","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/LoopNodesImportProgressDialog.java","lineNumber":104,"sourceCode":"    this.listpath = new ArrayList<String>();\n    this.nr = 0;\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 String[] open( Bowl bowl ) {\n    IRunnableWithProgress op = new IRunnableWithProgress() {\n      public void run( IProgressMonitor monitor ) throws InvocationTargetException, InterruptedException {\n        try {\n          Xpaths = 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":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/ui/trans/steps/getxmldata/LoopNodesImportProgressDialog.java#L86-L122","documentation":"Thrown (as an InvocationTargetException) by LoopNodesImportProgressDialog.run when doScan fails while scanning an XML file for candidate loop/XPath nodes. The dialog wraps any exception from the scan into an InvocationTargetException whose message is the localized 'ErrorScanningFile' text including the filename and e.toString(). The user sees this in the import-progress dialog when populating loop paths from a sample file.","triggerScenarios":"doScan throws while parsing the sample XML: malformed XML, unreadable file, encoding errors, or XPath evaluation failures during node enumeration on the file named in the message.","commonSituations":"Pointing the import dialog at a non-XML or corrupt file; wrong encoding (e.g. UTF-16 file read as UTF-8); very large files timing out; restricted characters in the document.","solutions":["Open the file named in the message in an XML editor to confirm it is well-formed","Check the wrapped cause (e.toString() is embedded in the message) for the parser error and line number","Re-save/normalize the file's encoding to UTF-8 and retry the scan"],"exampleFix":"// before\n<b><a>text</b></a> // malformed nesting\n// after\n<b><a>text</a></b>","handlingStrategy":"validation","validationCode":"// Validate the sample XML before running the import scan\ntry (Reader r = Files.newBufferedReader(Paths.get(filename), StandardCharsets.UTF_8)) {\n    DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(r));\n} // parse throws => fix file before scanning","typeGuard":null,"tryCatchPattern":"try {\n    progressDialog.open();\n} catch (InvocationTargetException e) {\n    log.error(\"Scan failed for \" + filename + \": \" + e.getCause());\n    // fix the XML document, then rerun the import\n}","preventionTips":["Run xmllint (or editor validation) on sample files before import","Standardize on UTF-8 encoding for XML samples","Keep sample files small and complete"],"tags":["kettle","dialog","xml","xpath","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"}