pentaho/pentaho-kettle · error · KettleException
It's not possible to save Class [" +…
Error message
It's not possible to save Class [" + element.getClass().getName() + "] to the repository
What it means
Thrown by PurRepository.saveRepositoryElement when the element's RepositoryObjectType is not one of the handled types (e.g. not a Job, Transformation, Database, Cluster Schema, Partition Schema, etc.). The switch statement hits its default case because this repository adapter does not support saving that class.
Solutions
- Use the dedicated save method for the element type (e.g. saveJob, saveDatabaseMeta, saveCondition)
- Verify the element's getRepositoryElementType() is a supported type before calling save()
- If saving users/security elements, use the appropriate security service instead
Example fix
// before repository.save(element, "comment", calendar, monitor); // element is a JobMeta // after repository.saveJob((JobMeta) element, "comment", calendar, monitor);
Defensive patterns
Strategy: type-guard
Validate before calling
RepositoryObjectType t = element.getRepositoryElementType(); boolean supported = t == RepositoryObjectType.TRANSFORMATION || t == RepositoryObjectType.JOB || t == RepositoryObjectType.DATABASE || t == RepositoryObjectType.CLUSTER_SCHEMA || t == RepositoryObjectType.PARTITION_SCHEMA;
Type guard
boolean isSupportedElement(RepositoryElementInterface el) {
return el != null && el.getRepositoryElementType() != null && !el.getRepositoryElementType().isSecurity();
} Try / catch
try {
repository.save(element, comment, calendar, monitor);
} catch (KettleException e) {
if (e.getMessage().contains("not possible to save Class")) {
log.error("Unsupported element type for generic save; use type-specific API", e);
}
} Prevention
- Use type-specific save methods (saveJob, saveTransformation, saveDatabaseMeta)
- Never pass user/security elements to generic save()
- Log element.getRepositoryElementType() when unsure
When it happens
Trigger: Calling PurRepository.save(element, versionComment, calendar, monitor) with an unsupported RepositoryElementInterface subtype whose type enum falls through the switch.
Common situations: Passing a custom RepositoryObject subclass; calling save() with elements like users/roles that must go through dedicated security APIs; version mismatches where new element types were added upstream but not to this adapter.
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
- AbsSecurityProvider.ERROR_0002_UNABLE_TO_ACCESS_IS_ALLOWED
- AddSequenceMeta.Exception.UnableToReadStepInfo
- AddSequenceMeta.Exception.UnableToSaveStepInfo
- Cannot assemble shared object of type
- Error loading job details
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/293038ae619052bb.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java:2199
saveTrans( element, versionComment, versionDate );
break;
case JOB:
saveJob( element, versionComment, versionDate );
break;
case DATABASE:
saveDatabaseMeta( element, versionComment, versionDate );
break;
case SLAVE_SERVER:
saveSlaveServer( element, versionComment, versionDate );
break;
case CLUSTER_SCHEMA:
saveClusterSchema( element, versionComment, versionDate );
break;
case PARTITION_SCHEMA:
savePartitionSchema( element, versionComment, versionDate );
break;
default:
throw new KettleException(
"It's not possible to save Class [" + element.getClass().getName() + "] to the repository" );
}
} catch ( Exception e ) {
throw new KettleException( "Unable to save repository element [" + element + "]", e );
}
}
private boolean isRenamed( final RepositoryElementInterface element, final RepositoryFile file )
throws KettleException {
if ( element.getObjectId() == null ) {
return false; // never been saved
}
String filename = element.getName();
switch ( element.getRepositoryElementType() ) {
case TRANSFORMATION:
filename += RepositoryObjectType.TRANSFORMATION.getExtension();
break;
case JOB:View on GitHub (pinned to f3058517a1)