pentaho/pentaho-kettle · error · IllegalArgumentException
Clone not supported for
Error message
Clone not supported for
What it means
BaseFileErrorHandling.clone() calls super.clone(); if the class (or a subclass) does not implement Cloneable, the JVM throws CloneNotSupportedException, which this code converts into an IllegalArgumentException naming the offending class. This is a programming/invariant error, not expected runtime input.
Solutions
- Add `implements Cloneable` to the offending class (the name is in the exception message)
- Ensure the default Object.clone() shallow copy is acceptable; deep-clone mutable fields if needed
- Alternatively, implement clone() manually without relying on super.clone()
Example fix
// before
class BaseFileErrorHandling { ... }
// after
class BaseFileErrorHandling implements Cloneable { ... } Defensive patterns
Strategy: try-catch
Validate before calling
if (!(obj instanceof BaseFileErrorHandling && obj instanceof Cloneable)) {
throw new IllegalArgumentException("Not cloneable: " + obj.getClass().getName());
} Type guard
boolean isCloneable(Object o) { return o instanceof Cloneable; } Try / catch
try { copy = errorHandling.clone(); }
catch (IllegalArgumentException e) {
log.error("Clone unsupported: {}", e.getMessage());
copy = new BaseFileErrorHandling(); // construct a fresh instance instead
} Prevention
- Always declare `implements Cloneable` when overriding clone()
- Deep-copy mutable fields in clone() for custom step subclasses
- Unit-test clone() on custom step meta classes
When it happens
Trigger: Subclassing BaseFileErrorHandling (or adding a non-cloneable field type that breaks Cloneable semantics) and having PDI clone the step's error-handling settings object without the class being Cloneable.
Common situations: Custom step development extending base file handling classes but forgetting to implement Cloneable; refactoring that removed Cloneable from the hierarchy.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- <toString()>: unable to make copy of value type: <getType()>
- AccessInputMeta.Exception.ErrorSavingToRepository
- AccessInputMeta.Exception.FileDoesNotExist
- AccessOutputMeta.Exception.ErrorGettingFields
- AccessOutputMeta.Exception.FileDoesNotExist
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/2d7f0fa9ed9fdf10.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/file/BaseFileErrorHandling.java:68
/** The extension of error files */
@Injection( name = "ERROR_FILES_EXTENTION" )
public String errorFilesExtension;
/** The directory that will contain line number files */
@Injection( name = "LINE_NR_FILES_TARGET_DIR" )
public String lineNumberFilesDestinationDirectory;
/** The extension of line number files */
@Injection( name = "LINE_NR_FILES_EXTENTION" )
public String lineNumberFilesExtension;
@Override
public Object clone() {
try {
return super.clone();
} catch ( CloneNotSupportedException ex ) {
throw new IllegalArgumentException( "Clone not supported for " + this.getClass().getName() );
}
}
}
View on GitHub (pinned to f3058517a1)