pentaho/pentaho-kettle · error · KettleXMLException
Unable to load job entry of type 'create file' from XML node
Error message
Unable to load job entry of type 'create file' from XML node
What it means
KettleXMLException thrown by JobEntryWriteToFile.loadXML when parsing the 'create file' (Write To File) job entry's XML node fails. The message is legacy ('create file') but the entry is the Write to File entry; the parse exception is chained as the cause.
Solutions
- Validate the job XML is well-formed
- Restore the kjb from backup/version control
- Recreate the Write to File job entry in Spoon
- Inspect the chained KettleXMLException for the exact parse failure
Example fix
// before
entry.loadXML(entrynode, databases, slaveServers); // throws
// after
try {
entry.loadXML(entrynode, databases, slaveServers);
} catch (KettleXMLException e) {
logError("Bad XML for write-to-file entry: " + e.getCause(), e);
} Defensive patterns
Strategy: try-catch
Validate before calling
Document doc = XMLHandler.loadXMLFile(inputStream);
if (doc == null) throw new IllegalArgumentException("invalid job XML"); Try / catch
try {
entry.loadXML(entrynode, databases, slaveServers);
} catch (KettleXMLException e) {
logError("XML load failed for write-to-file entry: " + e.getCause(), e);
} Prevention
- Validate kjb XML well-formedness after any manual edit
- Keep job files in version control for easy restore
- Use UTF-8 encoding consistently for job files
When it happens
Trigger: Calling loadXML on a node where XMLHandler.getTagValue fails — malformed XML, missing tags, or invalid characters in filename/content/encoding fields.
Common situations: Corrupted or hand-edited kjb files; XML truncated in transit; encoding mismatches when the content contains special characters.
Understand the failure class
Background: JSON parse error: "Unexpected token" / "not valid JSON" / "failed to parse" — what JSON parsers are really complaining about — this error's family across 45 libraries.
Related errors
- ERROR_0001_Cannot_Load_Job_Entry_From_Xml_Node
- ERROR_0001
- ExecSQLRowMeta.Exception.UnableToLoadStepInfoFromXML
- GPBulkLoaderMeta.Exception.UnableToReadStepInfoFromXML
- JobDosToUnix.Error.Exception.UnableLoadXML
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/30d0e2e82ad3458c.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/job/entries/writetofile/JobEntryWriteToFile.java:112
retval.append( " " ).append( XMLHandler.addTagValue( "encoding", encoding ) );
if ( parentJobMeta != null ) {
parentJobMeta.getNamedClusterEmbedManager().registerUrl( filename );
}
return retval.toString();
}
public void loadXML( Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers,
Repository rep, IMetaStore metaStore ) throws KettleXMLException {
try {
super.loadXML( entrynode, databases, slaveServers );
filename = XMLHandler.getTagValue( entrynode, "filename" );
createParentFolder = "Y".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, "createParentFolder" ) );
appendFile = "Y".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, "appendFile" ) );
content = XMLHandler.getTagValue( entrynode, "content" );
encoding = XMLHandler.getTagValue( entrynode, "encoding" );
} catch ( KettleXMLException xe ) {
throw new KettleXMLException( "Unable to load job entry of type 'create file' from XML node", xe );
}
}
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
List<SlaveServer> slaveServers ) throws KettleException {
try {
filename = rep.getJobEntryAttributeString( id_jobentry, "filename" );
createParentFolder = rep.getJobEntryAttributeBoolean( id_jobentry, "createParentFolder" );
appendFile = rep.getJobEntryAttributeBoolean( id_jobentry, "appendFile" );
content = rep.getJobEntryAttributeString( id_jobentry, "content" );
encoding = rep.getJobEntryAttributeString( id_jobentry, "encoding" );
} catch ( KettleException dbe ) {
throw new KettleException(
"Unable to load job entry of type 'create file' from the repository for id_jobentry=" + id_jobentry, dbe );
}
}
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ) throws KettleException {View on GitHub (pinned to f3058517a1)