pentaho/pentaho-kettle · error · KettleException
e (wrapped exception)
Error message
e (wrapped exception)
What it means
After building the in-memory DOM, AddXML serializes it via a Transformer (getSerializer().transform). If the javax.xml.transform Transformer throws TransformerException (or any other Exception), processRow wraps it in a KettleException with no additional message — the cause carries all detail. The error means DOM-to-string serialization failed at runtime.
Solutions
- Inspect the cause chain (KettleException.getCause()) for the real TransformerException message
- Check for conflicting JAXP transformer implementations (Xalan/Saxon JARs) on the classpath and remove duplicates
- Verify the step's encoding setting is a supported charset name
- Pin a known-good transformer factory via -Djavax.xml.transform.TransformerFactory system property
Example fix
// before (diagnosing)
catch (KettleException ke) { logError(ke.getMessage()); }
// after
catch (KettleException ke) { logError("XML transform failed", ke); logError("Root cause:", ke.getCause()); } Defensive patterns
Strategy: try-catch
Validate before calling
try {
Transformer t = TransformerFactory.newInstance().newTransformer();
t.transform(new DOMSource(DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument()), new StreamResult(new StringWriter()));
} catch (TransformerException e) {
failFast("JAXP transformer environment broken: " + e.getMessage());
} Try / catch
try { step.processRow(); } catch (KettleException ke) {
Throwable cause = ke.getCause();
if (cause instanceof TransformerException) {
logError("XML serialization failed: " + cause.getMessage(), cause);
}
} Prevention
- Keep a single JAXP TransformerFactory implementation on the classpath
- Use standard encodings (UTF-8) in step settings
- Smoke-test transformations on the target JDK before deployment
When it happens
Trigger: processRow calls this.getSerializer().transform(domSource, new StreamResult(sw)) and the transformer fails — e.g. transformer factory misconfiguration, encoding problems, or DOM state the transformer cannot serialize.
Common situations: JDK/JAXP transformer factory conflicts (e.g. wrong Xalan/Saxon on classpath); unsupported output encoding set in step settings; serializer plugin lookup returning a broken serializer.
Related errors
- Unable to transform DOM node with name [ +…
- AbsSecurityManager.ERROR_0004_UNABLE_TO_APPLY_LOGICAL_ROLES_TO_RUNTIME_ROLE
- AddSequenceMeta.Exception.ErrorLoadingStepInfo
- AggregateRowsMeta.Exception.UnableToLoadStepInfo
- AnalyticQueryMeta.Exception.UnableToLoadStepInfoFromXML
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/d308e5a1feb495f3.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/addxml/AddXML.java:157
Element e = xmldoc.createElement( element );
Node n = xmldoc.createTextNode( value );
e.appendChild( n );
root.appendChild( e );
} else {
Node n = xmldoc.createTextNode( value );
root.appendChild( n );
}
}
}
}
StringWriter sw = new StringWriter();
DOMSource domSource = new DOMSource( xmldoc );
try {
this.getSerializer().transform( domSource, new StreamResult( sw ) );
} catch ( TransformerException e ) {
throw new KettleException( e );
} catch ( Exception e ) {
throw new KettleException( e );
}
Object[] outputRowData = RowDataUtil.addValueData( r, getInputRowMeta().size(), sw.toString() );
putRow( data.outputRowMeta, outputRowData );
return true;
}
private String formatField( ValueMetaInterface valueMeta, Object valueData, XMLField field )
throws KettleValueException {
String retval = "";
if ( field == null ) {
return "";
}
View on GitHub (pinned to f3058517a1)