pentaho/pentaho-kettle · error · KettleException

It's not possible to rename Class [" +…

Error message

It's not possible to rename Class [" + element.getClass().getName() + "] to the repository

What it means

Thrown by PurRepository.rename when the element being renamed is of an unsupported type (switch default). The repository cannot compute the proper file extension for the rename, so it refuses with a KettleException.

Solutions

  1. Rename only supported element types (transformations, jobs, databases, cluster/partition schemas)
  2. Use dedicated APIs for renaming unsupported objects (e.g. user management)
  3. Verify element.getRepositoryElementType() before renaming

Example fix

// before
repository.rename(id, element, "newName", "comment", calendar); // element is unsupported type
// after
if (SUPPORTED_TYPES.contains(element.getRepositoryElementType())) {
  repository.rename(id, element, "newName", "comment", calendar);
}
Defensive patterns

Strategy: validation

Validate before calling

if (element.getRepositoryElementType() == null) {
  throw new IllegalArgumentException("Cannot rename: unknown repository element type");
}

Try / catch

try {
  repository.rename(id, element, newTitle, comments, calendar);
} catch (KettleException e) {
  if (e.getMessage().contains("not possible to rename Class")) {
    log.error("Rename unsupported for this element type", e);
  }
}

Prevention

When it happens

Trigger: Calling PurRepository.rename(ObjectId, RepositoryElementInterface, newTitle, comments, calendar) with an element type not handled (e.g. a custom or security element).

Common situations: Renaming programmatically-built elements lacking a valid type; attempting to rename objects like users via the generic rename API; PDI version drift introducing unhandled element types.

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


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/d8d5a1fd235df93b. Report an issue: GitHub.

Appendix: source

Thrown at plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java:2266

    StringBuilder buf = new StringBuilder( file.getPath().length() );
    buf.append( getParentPath( file.getPath() ) );
    buf.append( RepositoryFile.SEPARATOR );
    buf.append( checkAndSanitize( element.getName() ) );
    switch ( element.getRepositoryElementType() ) {
      case DATABASE:
        buf.append( RepositoryObjectType.DATABASE.getExtension() );
        break;
      case SLAVE_SERVER:
        buf.append( RepositoryObjectType.SLAVE_SERVER.getExtension() );
        break;
      case CLUSTER_SCHEMA:
        buf.append( RepositoryObjectType.CLUSTER_SCHEMA.getExtension() );
        break;
      case PARTITION_SCHEMA:
        buf.append( RepositoryObjectType.PARTITION_SCHEMA.getExtension() );
        break;
      default:
        throw new KettleException( "It's not possible to rename Class [" + element.getClass().getName()
          + "] to the repository" );
    }

    readWriteLock.writeLock().lock();
    try {
      pur.moveFile( file.getId(), buf.toString(), null );
    } finally {
      readWriteLock.writeLock().unlock();
    }
  }

  /**
   * Use {@linkplain #saveKettleEntity} instead
   */
  @Deprecated
  protected void saveJob0( RepositoryElementInterface element, String versionComment,
                           boolean saveSharedObjects,
                           boolean checkLock, boolean checkRename,

View on GitHub (pinned to f3058517a1)