{"record":{"id":"5db387503bccd108","repo":"pentaho/pentaho-kettle","slug":"jobevalfilesmetrics-error-exception-unableloadxml","errorCode":null,"errorMessage":"JobEvalFilesMetrics.Error.Exception.UnableLoadXML","messagePattern":"JobEvalFilesMetrics\\.Error\\.Exception\\.UnableLoadXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/evalfilesmetrics/JobEntryEvalFilesMetrics.java","lineNumber":267,"sourceCode":"        sourceIncludeSubfolders[i] = XMLHandler.getTagValue( fnode, \"include_subFolders\" );\n      }\n\n      resultFilenamesWildcard = XMLHandler.getTagValue( entrynode, \"result_filenames_wildcard\" );\n      ResultFieldFile = XMLHandler.getTagValue( entrynode, \"result_field_file\" );\n      ResultFieldWildcard = XMLHandler.getTagValue( entrynode, \"result_field_wildcard\" );\n      ResultFieldIncludesubFolders = XMLHandler.getTagValue( entrynode, \"result_field_includesubfolders\" );\n      comparevalue = XMLHandler.getTagValue( entrynode, \"comparevalue\" );\n      minvalue = XMLHandler.getTagValue( entrynode, \"minvalue\" );\n      maxvalue = XMLHandler.getTagValue( entrynode, \"maxvalue\" );\n      successConditionType =\n        JobEntrySimpleEval.getSuccessNumberConditionByCode( Const.NVL( XMLHandler.getTagValue(\n          entrynode, \"successnumbercondition\" ), \"\" ) );\n      sourceFiles = getSourceFilesByCode( Const.NVL( XMLHandler.getTagValue( entrynode, \"source_files\" ), \"\" ) );\n      evaluationType =\n        getEvaluationTypeByCode( Const.NVL( XMLHandler.getTagValue( entrynode, \"evaluation_type\" ), \"\" ) );\n      scale = getScaleByCode( Const.NVL( XMLHandler.getTagValue( entrynode, \"scale\" ), \"\" ) );\n    } catch ( KettleXMLException xe ) {\n      throw new KettleXMLException( BaseMessages.getString(\n        PKG, \"JobEvalFilesMetrics.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      // How many arguments?\n      int argnr = rep.countNrJobEntryAttributes( id_jobentry, \"source_filefolder\" );\n      allocate( argnr );\n\n      // Read them all...\n      for ( int a = 0; a < argnr; a++ ) {\n        sourceFileFolder[a] = rep.getJobEntryAttributeString( id_jobentry, a, \"source_filefolder\" );\n        sourceWildcard[a] = rep.getJobEntryAttributeString( id_jobentry, a, \"wildcard\" );\n        sourceIncludeSubfolders[a] = rep.getJobEntryAttributeString( id_jobentry, a, \"include_subFolders\" );\n      }\n","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/evalfilesmetrics/JobEntryEvalFilesMetrics.java#L249-L285","documentation":"JobEntryEvalFilesMetrics.loadXML() deserializes the 'Evaluate files metrics' job entry from XML (reading tags like source_files, evaluation_type, scale, successnumbercondition); a KettleXMLException is rethrown as a new KettleXMLException with localized message 'JobEvalFilesMetrics.Error.Exception.UnableLoadXML'. It means the entry could not be reconstructed from the job XML.","triggerScenarios":"Loading a .kjb containing a JobEntryEvalFilesMetrics node where XMLHandler.getTagValue or the code-to-enum conversions (getSourceFilesByCode, getEvaluationTypeByCode, getScaleByCode) throw, or super.loadXML fails.","commonSituations":"Malformed or hand-edited XML; unknown codes in source_files/evaluation_type/scale attributes from a different Pentaho version; truncated export file.","solutions":["Examine the chained KettleXMLException for the failing tag or conversion.","Open/repair the .kjb in Spoon, ensuring source_files, evaluation_type and scale elements contain valid codes.","Re-export the job from the same Pentaho version used at runtime.","If values were hand-edited, restore the canonical codes the entry expects."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Ensure expected tags exist before loading the entry\nNode node = XMLHandler.getSubNode(entrynode, \"source_files\");\nif (node == null) {\n  throw new IllegalArgumentException(\"Missing source_files element in EvalFilesMetrics XML\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  JobMeta meta = new JobMeta(jobFile, rep, metaStore);\n} catch (KettleXMLException e) {\n  logError(\"Unable to load EvalFilesMetrics entry: \" + e.getMessage(), e);\n  // repair or restore the job XML before retrying\n}","preventionTips":["Only modify job XML through Spoon so codes for source_files/evaluation_type/scale stay valid.","Version-match the tooling that exports and imports .kjb files.","Keep pre-edit backups of job definitions.","Validate exported XML against the expected tag set before importing."],"tags":["xml","deserialization","job-entry","kettle"],"backgroundTag":"json-unmarshal-failed","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"}