{"record":{"id":"70ec3540be5a94a7","repo":"pentaho/pentaho-kettle","slug":"jobxmlwellformed-error-exception-unableloadxml","errorCode":"JobXMLWellFormed.Error.Exception.UnableLoadXML","errorMessage":"JobXMLWellFormed.Error.Exception.UnableLoadXML","messagePattern":"JobXMLWellFormed\\.Error\\.Exception\\.UnableLoadXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/job/entries/xmlwellformed/JobEntryXMLWellFormed.java","lineNumber":174,"sourceCode":"      resultfilenames = XMLHandler.getTagValue( entrynode, \"resultfilenames\" );\n\n      Node fields = XMLHandler.getSubNode( entrynode, \"fields\" );\n\n      // How many field arguments?\n      int nrFields = XMLHandler.countNodes( fields, \"field\" );\n      source_filefolder = new String[nrFields];\n      wildcard = new String[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        wildcard[i] = XMLHandler.getTagValue( fnode, \"wildcard\" );\n      }\n    } catch ( KettleXMLException xe ) {\n\n      throw new KettleXMLException( BaseMessages.getString( PKG, \"JobXMLWellFormed.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      arg_from_previous = rep.getJobEntryAttributeBoolean( id_jobentry, \"arg_from_previous\" );\n      include_subfolders = rep.getJobEntryAttributeBoolean( id_jobentry, \"include_subfolders\" );\n\n      nr_errors_less_than = rep.getJobEntryAttributeString( id_jobentry, \"nr_errors_less_than\" );\n      success_condition = rep.getJobEntryAttributeString( id_jobentry, \"success_condition\" );\n      resultfilenames = rep.getJobEntryAttributeString( id_jobentry, \"resultfilenames\" );\n\n      // How many arguments?\n      int argnr = rep.countNrJobEntryAttributes( id_jobentry, \"source_filefolder\" );\n      source_filefolder = new String[argnr];\n      wildcard = new String[argnr];\n","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/job/entries/xmlwellformed/JobEntryXMLWellFormed.java#L156-L192","documentation":"JobEntryXMLWellFormed.loadXML() failed while parsing the job entry's XML node (reading source_filefolder/wildcard arrays and related fields). The KettleXMLException from XMLHandler is wrapped and rethrown with the localized message 'UnableLoadXML', meaning the XML Well-Formed Validator entry could not be deserialized from the job file.","triggerScenarios":"loadXML() reads fields files count, source_filefolder[i], wildcard[i] etc. from entrynode and XMLHandler throws KettleXMLException due to malformed/missing tags in the job XML.","commonSituations":"Job file hand-edited so the <fields> section is inconsistent with the declared row count; truncated .kjb file; PDI version tag changes; encoding corruption.","solutions":["Inspect the job entry's XML node in the .kjb file, especially the <fields> section and its <count> value","Recreate the XML Well-Formed Validator entry in Spoon and re-save","Validate the whole job file XML for well-formedness","Check for version mismatch between the file and the PDI engine"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// validate the <fields><count> matches actual field nodes before load\n// parse job.kjb and check that fields/count equals number of <field> children","typeGuard":null,"tryCatchPattern":"try {\n  jobMeta.loadXml( jobFile );\n} catch ( KettleXMLException e ) {\n  if ( e.getMessage().contains( \"UnableLoadXML\" ) || e.getMessage().contains( \"XMLWellFormed\" ) ) {\n    logError( \"XMLWellFormed entry node corrupt; fix <fields> section in job file\" );\n  } else { throw e; }\n}","preventionTips":["Do not hand-edit the <fields> block; add rows through the step dialog","Keep the fields count consistent with the number of field nodes","Back up job files before edits or version migrations","Recreate entries that fail to load instead of patching XML manually"],"tags":["kettle","xml","job-entry","deserialization","validation"],"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"}