{"record":{"id":"9324fd4a38995493","repo":"pentaho/pentaho-kettle","slug":"unable-to-load-job-entry-of-type-mssql-bulk-load-from-xml","errorCode":null,"errorMessage":"Unable to load job entry of type 'MSsql bulk load' from XML node","messagePattern":"Unable to load job entry of type 'MSsql bulk load' from XML node","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/mssqlbulkload/JobEntryMssqlBulkLoad.java","lineNumber":212,"sourceCode":"      endfile = Const.toInt( XMLHandler.getTagValue( entrynode, \"endfile\" ), 0 );\n\n      orderby = XMLHandler.getTagValue( entrynode, \"orderby\" );\n      orderdirection = XMLHandler.getTagValue( entrynode, \"orderdirection\" );\n\n      errorfilename = XMLHandler.getTagValue( entrynode, \"errorfilename\" );\n\n      maxerrors = Const.toInt( XMLHandler.getTagValue( entrynode, \"maxerrors\" ), 0 );\n      batchsize = Const.toInt( XMLHandler.getTagValue( entrynode, \"batchsize\" ), 0 );\n      rowsperbatch = Const.toInt( XMLHandler.getTagValue( entrynode, \"rowsperbatch\" ), 0 );\n      adddatetime = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"adddatetime\" ) );\n      String dbname = XMLHandler.getTagValue( entrynode, \"connection\" );\n      addfiletoresult = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"addfiletoresult\" ) );\n      truncate = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"truncate\" ) );\n\n      connection = DatabaseMeta.findDatabase( databases, dbname );\n\n    } catch ( KettleException e ) {\n      throw new KettleXMLException( \"Unable to load job entry of type 'MSsql bulk load' from XML node\", e );\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      schemaname = rep.getJobEntryAttributeString( id_jobentry, \"schemaname\" );\n      tablename = rep.getJobEntryAttributeString( id_jobentry, \"tablename\" );\n      filename = rep.getJobEntryAttributeString( id_jobentry, \"filename\" );\n\n      datafiletype = rep.getJobEntryAttributeString( id_jobentry, \"datafiletype\" );\n      fieldterminator = rep.getJobEntryAttributeString( id_jobentry, \"fieldterminator\" );\n\n      lineterminated = rep.getJobEntryAttributeString( id_jobentry, \"lineterminated\" );\n      codepage = rep.getJobEntryAttributeString( id_jobentry, \"codepage\" );\n      specificcodepage = rep.getJobEntryAttributeString( id_jobentry, \"specificcodepage\" );\n      formatfilename = rep.getJobEntryAttributeString( id_jobentry, \"formatfilename\" );\n      firetriggers = rep.getJobEntryAttributeBoolean( id_jobentry, \"firetriggers\" );","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/mssqlbulkload/JobEntryMssqlBulkLoad.java#L194-L230","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Open the .kjb in a text editor and verify the <entry type='MSSQL_BULK_LOAD'> node contains all expected child tags with correct names.","Re-export/recreate the job entry in Spoon so well-formed XML is generated.","Ensure the shared connection named in the <connection> tag exists in the job's shared.xml / databases list.","Match Pentaho/Kettle versions between the file's producer and consumer."],"exampleFix":"// before (malformed tag)\n<truncate>Y</truncated>\n// after\n<truncate>Y</truncate>","handlingStrategy":"try-catch","validationCode":"// before load\nString node = XMLHandler.getTagValue( entrynode, \"connection\" );\nif ( node == null ) throw new KettleXMLException( \"missing <connection> tag in MSSQL bulk load entry\" );","typeGuard":"boolean entryOk = (entrynode != null && XMLHandler.getTagValue( entrynode, \"truncate\" ) != null);","tryCatchPattern":"try { jobEntry.loadXML( entrynode, databases, metaStore ); } catch ( KettleXMLException e ) { logError( \"Cannot read MSSQL bulk load entry from XML: \" + e.getMessage(), e ); }","preventionTips":["Do not hand-edit .kjb files; edit in Spoon","Keep producer and consumer Kettle versions aligned","Ensure referenced shared connections exist in shared.xml","Validate XML well-formedness before loading"],"tags":["kettle","xml","job-entry","deserialization","mssql"],"backgroundTag":"xml-parse-error","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"}