{"record":{"id":"39633853f6459d3c","repo":"pentaho/pentaho-kettle","slug":"jobmovefiles-error-exception-unableloadxml","errorCode":null,"errorMessage":"JobMoveFiles.Error.Exception.UnableLoadXML","messagePattern":"JobMoveFiles\\.Error\\.Exception\\.UnableLoadXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/movefiles/JobEntryMoveFiles.java","lineNumber":267,"sourceCode":"      simulate = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"simulate\" ) );\n\n      Node fields = XMLHandler.getSubNode( entrynode, \"fields\" );\n\n      // How many field arguments?\n      int nrFields = XMLHandler.countNodes( fields, \"field\" );\n      allocate( nrFields );\n\n      // Read them all...\n      for ( int i = 0; i < nrFields; i++ ) {\n        Node fnode = XMLHandler.getSubNodeByNr( fields, \"field\", i );\n\n        source_filefolder[i] = XMLHandler.getTagValue( fnode, \"source_filefolder\" );\n        destination_filefolder[i] = XMLHandler.getTagValue( fnode, \"destination_filefolder\" );\n        wildcard[i] = XMLHandler.getTagValue( fnode, \"wildcard\" );\n      }\n    } catch ( KettleXMLException xe ) {\n\n      throw new KettleXMLException(\n        BaseMessages.getString( PKG, \"JobMoveFiles.Error.Exception.UnableLoadXML\" ), xe );\n    }\n  }\n\n  public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,\n    List<SlaveServer> slaveServers ) throws KettleException {\n    try {\n      move_empty_folders = rep.getJobEntryAttributeBoolean( id_jobentry, \"move_empty_folders\" );\n      arg_from_previous = rep.getJobEntryAttributeBoolean( id_jobentry, \"arg_from_previous\" );\n      include_subfolders = rep.getJobEntryAttributeBoolean( id_jobentry, \"include_subfolders\" );\n      add_result_filesname = rep.getJobEntryAttributeBoolean( id_jobentry, \"add_result_filesname\" );\n      destination_is_a_file = rep.getJobEntryAttributeBoolean( id_jobentry, \"destination_is_a_file\" );\n      create_destination_folder = rep.getJobEntryAttributeBoolean( id_jobentry, \"create_destination_folder\" );\n      nr_errors_less_than = rep.getJobEntryAttributeString( id_jobentry, \"nr_errors_less_than\" );\n      success_condition = rep.getJobEntryAttributeString( id_jobentry, \"success_condition\" );\n      add_date = rep.getJobEntryAttributeBoolean( id_jobentry, \"add_date\" );\n      add_time = rep.getJobEntryAttributeBoolean( id_jobentry, \"add_time\" );\n      SpecifyFormat = rep.getJobEntryAttributeBoolean( id_jobentry, \"SpecifyFormat\" );","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/movefiles/JobEntryMoveFiles.java#L249-L285","documentation":"JobEntryMoveFiles.loadXML() wraps any KettleXMLException raised while parsing the entry's XML node (fields array, source_filefolder, destination_filefolder, wildcard tags) into a new KettleXMLException with localized message 'JobMoveFiles.Error.Exception.UnableLoadXML'. It signals the serialized job entry could not be read from the .kjb/.xml document.","triggerScenarios":"Loading a .kjb file whose <fields> block for the Move Files entry is malformed, missing expected tags, or produced by an incompatible writer; XMLHandler.getTagValue throws KettleXMLException on structurally invalid XML.","commonSituations":"Hand-edited or truncated .kjb file; file generated by a newer PDI version with a schema change; encoding corruption during transfer; merging conflicts in version-controlled .kjb files.","solutions":["Open the .kjb in Spoon to locate and fix the malformed Move Files entry node","Restore the file from backup or source control before the corruption","Compare the XML block against a known-good Move Files entry and repair tags (source_filefolder, destination_filefolder, wildcard)","Check the chained KettleXMLException cause for the exact XML parse error location"],"exampleFix":"// before: <wildcard>*.csv<wildcard>  (unclosed tag)\n// after\n//   <fields>\n//     <source_filefolder>/data/in</source_filefolder>\n//     <destination_filefolder>/data/out</destination_filefolder>\n//     <wildcard>.*\\.csv$</wildcard>\n//   </fields>","handlingStrategy":"try-catch","validationCode":"// validate XML before loading\nDocument doc = XMLHandler.loadXMLFile(new File(kjbPath));\nif (XMLHandler.getSubNode(XMLHandler.getSubNode(doc, \"entry\"), \"fields\") == null) {\n  throw new IllegalArgumentException(\"Move Files entry is missing its <fields> block\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  entry.loadXML(entryNode, databases, slaveServers);\n} catch (KettleXMLException e) {\n  Throwable cause = e.getCause();\n  // cause pinpoints the XML parse error; repair the .kjb or restore from VCS\n  logError(\"Move Files XML load failed: \" + (cause != null ? cause.getMessage() : e.getMessage()), e);\n  throw e;\n}","preventionTips":["Don't hand-edit .kjb files; use Spoon or the Kettle XML API","Commit .kjb files to VCS so corruption is recoverable","Validate XML well-formedness after any programmatic transformation","Check version compatibility when opening files written by newer PDI versions"],"tags":["pdi","kettle","xml","parse"],"backgroundTag":"json-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"}