pentaho/pentaho-kettle · error · KettleXMLException

Unable to load job entry of type 'Mysql bulk load' from XML…

Error message

Unable to load job entry of type 'Mysql bulk load' from XML node

What it means

KettleXMLException thrown by JobEntryMysqlBulkLoad.loadXML() when parsing the XML node for a 'Mysql bulk load' job entry fails with a KettleException. It indicates the serialized XML for this entry is unreadable or its tags are missing/misnamed.

Solutions

  1. Verify and repair the <entry type='MYSQL_BULK_LOAD'> XML tags with correct names and values.
  2. Recreate the job entry in Spoon to regenerate valid XML.
  3. Add the named connection to the job's databases/shared connections.
  4. Use matching Kettle/Pentaho versions for producing and consuming the file.

Example fix

// before
<prorityvalue>abc</prorityvalue>
// after
<prorityvalue>5</prorityvalue>
Defensive patterns

Strategy: try-catch

Validate before calling

// before load
if ( entrynode == null ) throw new KettleXMLException( "null entry node for MYSQL_BULK_LOAD" );
if ( XMLHandler.getTagValue( entrynode, "connection" ) == null ) throw new KettleXMLException( "missing <connection> tag" );

Type guard

boolean ok = (entrynode != null && XMLHandler.getTagValue( entrynode, "localinfile" ) != null);

Try / catch

try { jobEntry.loadXML( entrynode, databases, metaStore ); } catch ( KettleXMLException e ) { logError( "Cannot parse MYSQL_BULK_LOAD XML: " + e.getMessage(), e ); }

Prevention

When it happens

Trigger: Loading a job from XML when reading tags (tablename, filename, localinfile, prorityvalue, connection, addfiletoresult) throws or DatabaseMeta.findDatabase cannot resolve the connection name against the supplied list.

Common situations: Corrupt or truncated .kjb; cross-version file incompatibility; connection referenced in XML missing from shared connections.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/job/entries/mysqlbulkload/JobEntryMysqlBulkLoad.java:158

      schemaname = XMLHandler.getTagValue( entrynode, "schemaname" );
      tablename = XMLHandler.getTagValue( entrynode, "tablename" );
      filename = XMLHandler.getTagValue( entrynode, "filename" );
      separator = XMLHandler.getTagValue( entrynode, "separator" );
      enclosed = XMLHandler.getTagValue( entrynode, "enclosed" );
      escaped = XMLHandler.getTagValue( entrynode, "escaped" );

      linestarted = XMLHandler.getTagValue( entrynode, "linestarted" );
      lineterminated = XMLHandler.getTagValue( entrynode, "lineterminated" );
      replacedata = "Y".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, "replacedata" ) );
      ignorelines = XMLHandler.getTagValue( entrynode, "ignorelines" );
      listattribut = XMLHandler.getTagValue( entrynode, "listattribut" );
      localinfile = "Y".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, "localinfile" ) );
      prorityvalue = Const.toInt( XMLHandler.getTagValue( entrynode, "prorityvalue" ), -1 );
      String dbname = XMLHandler.getTagValue( entrynode, "connection" );
      addfiletoresult = "Y".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, "addfiletoresult" ) );
      connection = DatabaseMeta.findDatabase( databases, dbname );
    } catch ( KettleException e ) {
      throw new KettleXMLException( "Unable to load job entry of type 'Mysql bulk load' from XML node", e );
    }
  }

  public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
    List<SlaveServer> slaveServers ) throws KettleException {
    try {
      schemaname = rep.getJobEntryAttributeString( id_jobentry, "schemaname" );
      tablename = rep.getJobEntryAttributeString( id_jobentry, "tablename" );
      filename = rep.getJobEntryAttributeString( id_jobentry, "filename" );
      separator = rep.getJobEntryAttributeString( id_jobentry, "separator" );
      enclosed = rep.getJobEntryAttributeString( id_jobentry, "enclosed" );
      escaped = rep.getJobEntryAttributeString( id_jobentry, "escaped" );
      linestarted = rep.getJobEntryAttributeString( id_jobentry, "linestarted" );
      lineterminated = rep.getJobEntryAttributeString( id_jobentry, "lineterminated" );
      replacedata = rep.getJobEntryAttributeBoolean( id_jobentry, "replacedata" );
      ignorelines = rep.getJobEntryAttributeString( id_jobentry, "ignorelines" );
      listattribut = rep.getJobEntryAttributeString( id_jobentry, "listattribut" );
      localinfile = rep.getJobEntryAttributeBoolean( id_jobentry, "localinfile" );

View on GitHub (pinned to f3058517a1)