pentaho/pentaho-kettle · error · KettleXMLException

GetXMLDataMeta.Exception.ErrorLoadingXML (localized message…

Error message

GetXMLDataMeta.Exception.ErrorLoadingXML (localized message with error)

What it means

GetXMLDataMeta.loadXML wraps any exception raised while reading step settings from the transformation XML (ktr) in a KettleXMLException with localized message 'GetXMLDataMeta.Exception.ErrorLoadingXML' plus e.toString(). It means the step's XML metadata could not be deserialized.

Solutions

  1. Read the chained e.toString() message to find which XML tag failed to parse.
  2. Open the .ktr in a text editor and validate the XML is well-formed; repair or restore from backup/version control.
  3. Recreate the GetXMLData step in Spoon and re-enter its settings, then save a fresh .ktr.
  4. Align PDI versions: open the transformation with the version that produced it, or migrate via Spoon.

Example fix

// before: malformed tag in .ktr
<lastmodtime_field></lastmodtime-field>
// after: well-formed, correctly closed tag
<lastmodtime_field></lastmodtime_field>
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate the .ktr XML before loading
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse( new File( "t.ktr" ) ); // throws on malformed XML

Try / catch

try { transMeta = new TransMeta( "t.ktr" ); } catch ( KettleXMLException e ) { log.error( "Bad step metadata: " + e.getMessage(), e ); /* restore from VCS/backup */ }

Prevention

When it happens

Trigger: The GetXMLDataMeta constructor taking (stepnode, ...) throws when XMLHandler.getTagValue or related parsing fails - typically a structural problem in the <step> node of the .ktr file.

Common situations: Hand-edited or corrupted .ktr files, transformations produced by a newer/older PDI version with changed XML schema, XML escaping issues in field names, repository/metadata import of foreign files.

Related errors


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

Appendix: source

Thrown at plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/getxmldata/GetXMLDataMeta.java:857

      // Do we skip rows before starting to read
      loopxpath = XMLHandler.getTagValue( stepnode, TAG_LOOPXPATH );

      inFields = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, TAG_IS_IN_FIELDS ) );
      IsAFile = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, TAG_IS_A_FILE ) );

      xmlField = XMLHandler.getTagValue( stepnode, TAG_XML_FIELD );
      prunePath = XMLHandler.getTagValue( stepnode, TAG_PRUNE_PATH );

      shortFileFieldName = XMLHandler.getTagValue( stepnode, TAG_SHORT_FILE_FIELD_NAME );
      pathFieldName = XMLHandler.getTagValue( stepnode, TAG_PATH_FIELD_NAME );
      hiddenFieldName = XMLHandler.getTagValue( stepnode, TAG_HIDDEN_FIELD_NAME );
      lastModificationTimeFieldName = XMLHandler.getTagValue( stepnode, TAG_LAST_MODIFICATION_TIME_FIELD_NAME );
      uriNameFieldName = XMLHandler.getTagValue( stepnode, TAG_URI_NAME_FIELD_NAME );
      rootUriNameFieldName = XMLHandler.getTagValue( stepnode, TAG_ROOT_URI_NAME_FIELD_NAME );
      extensionFieldName = XMLHandler.getTagValue( stepnode, TAG_EXTENSION_FIELD_NAME );
      sizeFieldName = XMLHandler.getTagValue( stepnode, TAG_SIZE_FIELD_NAME );
    } catch ( Exception e ) {
      throw new KettleXMLException( BaseMessages.getString( PKG, "GetXMLDataMeta.Exception.ErrorLoadingXML", e
          .toString() ) );
    }
  }

  public void allocate( int nrfiles, int nrfields ) {
    allocateFiles( nrfiles );
    inputFields = new GetXMLDataField[nrfields];
  }

  public void allocateFiles( int nrfiles ) {
    fileName = new String[nrfiles];
    fileMask = new String[nrfiles];
    excludeFileMask = new String[nrfiles];
    fileRequired = new String[nrfiles];
    includeSubFolders = new String[nrfiles];
  }

  public void setDefault() {

View on GitHub (pinned to f3058517a1)