pentaho/pentaho-kettle · error · KettleXMLException

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

Error message

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

What it means

KettleXMLException thrown by JobEntryMssqlBulkLoad.loadXML() when parsing the XML <entry> node for an 'MSsql bulk load' job entry fails with a KettleException. It indicates the job's serialized XML is malformed or missing expected tags for this entry type.

Solutions

  1. Open the .kjb in a text editor and verify the <entry type='MSSQL_BULK_LOAD'> node contains all expected child tags with correct names.
  2. Re-export/recreate the job entry in Spoon so well-formed XML is generated.
  3. Ensure the shared connection named in the <connection> tag exists in the job's shared.xml / databases list.
  4. Match Pentaho/Kettle versions between the file's producer and consumer.

Example fix

// before (malformed tag)
<truncate>Y</truncated>
// after
<truncate>Y</truncate>
Defensive patterns

Strategy: try-catch

Validate before calling

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

Type guard

boolean entryOk = (entrynode != null && XMLHandler.getTagValue( entrynode, "truncate" ) != null);

Try / catch

try { jobEntry.loadXML( entrynode, databases, metaStore ); } catch ( KettleXMLException e ) { logError( "Cannot read MSSQL bulk load entry from XML: " + e.getMessage(), e ); }

Prevention

When it happens

Trigger: Loading a job from XML (JobMeta.fromXML / opening a .kjb file) where reading tags like schemaname, tablename, filename, addfiletoresult, truncate, or resolving the connection via DatabaseMeta.findDatabase throws (e.g. null entrynode or unexpected node structure).

Common situations: Hand-edited or truncated .kjb files; XML produced by a newer Pentaho version loaded in an older one (missing tags); shared connection referenced in the XML that cannot be resolved against the supplied databases list.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/job/entries/mssqlbulkload/JobEntryMssqlBulkLoad.java:212

      endfile = Const.toInt( XMLHandler.getTagValue( entrynode, "endfile" ), 0 );

      orderby = XMLHandler.getTagValue( entrynode, "orderby" );
      orderdirection = XMLHandler.getTagValue( entrynode, "orderdirection" );

      errorfilename = XMLHandler.getTagValue( entrynode, "errorfilename" );

      maxerrors = Const.toInt( XMLHandler.getTagValue( entrynode, "maxerrors" ), 0 );
      batchsize = Const.toInt( XMLHandler.getTagValue( entrynode, "batchsize" ), 0 );
      rowsperbatch = Const.toInt( XMLHandler.getTagValue( entrynode, "rowsperbatch" ), 0 );
      adddatetime = "Y".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, "adddatetime" ) );
      String dbname = XMLHandler.getTagValue( entrynode, "connection" );
      addfiletoresult = "Y".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, "addfiletoresult" ) );
      truncate = "Y".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, "truncate" ) );

      connection = DatabaseMeta.findDatabase( databases, dbname );

    } catch ( KettleException e ) {
      throw new KettleXMLException( "Unable to load job entry of type 'MSsql 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" );

      datafiletype = rep.getJobEntryAttributeString( id_jobentry, "datafiletype" );
      fieldterminator = rep.getJobEntryAttributeString( id_jobentry, "fieldterminator" );

      lineterminated = rep.getJobEntryAttributeString( id_jobentry, "lineterminated" );
      codepage = rep.getJobEntryAttributeString( id_jobentry, "codepage" );
      specificcodepage = rep.getJobEntryAttributeString( id_jobentry, "specificcodepage" );
      formatfilename = rep.getJobEntryAttributeString( id_jobentry, "formatfilename" );
      firetriggers = rep.getJobEntryAttributeBoolean( id_jobentry, "firetriggers" );

View on GitHub (pinned to f3058517a1)