pentaho/pentaho-kettle · error · KettleXMLException

JobEvalFilesMetrics.Error.Exception.UnableLoadXML

Error message

JobEvalFilesMetrics.Error.Exception.UnableLoadXML

What it means

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.

Solutions

  1. Examine the chained KettleXMLException for the failing tag or conversion.
  2. Open/repair the .kjb in Spoon, ensuring source_files, evaluation_type and scale elements contain valid codes.
  3. Re-export the job from the same Pentaho version used at runtime.
  4. If values were hand-edited, restore the canonical codes the entry expects.
Defensive patterns

Strategy: try-catch

Validate before calling

// Ensure expected tags exist before loading the entry
Node node = XMLHandler.getSubNode(entrynode, "source_files");
if (node == null) {
  throw new IllegalArgumentException("Missing source_files element in EvalFilesMetrics XML");
}

Try / catch

try {
  JobMeta meta = new JobMeta(jobFile, rep, metaStore);
} catch (KettleXMLException e) {
  logError("Unable to load EvalFilesMetrics entry: " + e.getMessage(), e);
  // repair or restore the job XML before retrying
}

Prevention

When it happens

Trigger: Loading a .kjb containing a JobEntryEvalFilesMetrics node where XMLHandler.getTagValue or the code-to-enum conversions (getSourceFilesByCode, getEvaluationTypeByCode, getScaleByCode) throw, or super.loadXML fails.

Common situations: Malformed or hand-edited XML; unknown codes in source_files/evaluation_type/scale attributes from a different Pentaho version; truncated export file.

Understand the failure class

Background: "failed to unmarshal" / json.Unmarshal errors: why parsing a response into a Go struct fails and how to fix it — this error's family across 23 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/5db387503bccd108. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/job/entries/evalfilesmetrics/JobEntryEvalFilesMetrics.java:267

        sourceIncludeSubfolders[i] = XMLHandler.getTagValue( fnode, "include_subFolders" );
      }

      resultFilenamesWildcard = XMLHandler.getTagValue( entrynode, "result_filenames_wildcard" );
      ResultFieldFile = XMLHandler.getTagValue( entrynode, "result_field_file" );
      ResultFieldWildcard = XMLHandler.getTagValue( entrynode, "result_field_wildcard" );
      ResultFieldIncludesubFolders = XMLHandler.getTagValue( entrynode, "result_field_includesubfolders" );
      comparevalue = XMLHandler.getTagValue( entrynode, "comparevalue" );
      minvalue = XMLHandler.getTagValue( entrynode, "minvalue" );
      maxvalue = XMLHandler.getTagValue( entrynode, "maxvalue" );
      successConditionType =
        JobEntrySimpleEval.getSuccessNumberConditionByCode( Const.NVL( XMLHandler.getTagValue(
          entrynode, "successnumbercondition" ), "" ) );
      sourceFiles = getSourceFilesByCode( Const.NVL( XMLHandler.getTagValue( entrynode, "source_files" ), "" ) );
      evaluationType =
        getEvaluationTypeByCode( Const.NVL( XMLHandler.getTagValue( entrynode, "evaluation_type" ), "" ) );
      scale = getScaleByCode( Const.NVL( XMLHandler.getTagValue( entrynode, "scale" ), "" ) );
    } catch ( KettleXMLException xe ) {
      throw new KettleXMLException( BaseMessages.getString(
        PKG, "JobEvalFilesMetrics.Error.Exception.UnableLoadXML" ), xe );
    }
  }

  public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
    List<SlaveServer> slaveServers ) throws KettleException {
    try {
      // How many arguments?
      int argnr = rep.countNrJobEntryAttributes( id_jobentry, "source_filefolder" );
      allocate( argnr );

      // Read them all...
      for ( int a = 0; a < argnr; a++ ) {
        sourceFileFolder[a] = rep.getJobEntryAttributeString( id_jobentry, a, "source_filefolder" );
        sourceWildcard[a] = rep.getJobEntryAttributeString( id_jobentry, a, "wildcard" );
        sourceIncludeSubfolders[a] = rep.getJobEntryAttributeString( id_jobentry, a, "include_subFolders" );
      }

View on GitHub (pinned to f3058517a1)