{"record":{"id":"d8d5a1fd235df93b","repo":"pentaho/pentaho-kettle","slug":"it-s-not-possible-to-rename-class-element-getclass-getname","errorCode":null,"errorMessage":"It's not possible to rename Class [\" + element.getClass().getName() + \"] to the repository","messagePattern":"It's not possible to rename Class \\[\" \\+ element\\.getClass\\(\\)\\.getName\\(\\) \\+ \"\\] to the repository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java","lineNumber":2266,"sourceCode":"    StringBuilder buf = new StringBuilder( file.getPath().length() );\n    buf.append( getParentPath( file.getPath() ) );\n    buf.append( RepositoryFile.SEPARATOR );\n    buf.append( checkAndSanitize( element.getName() ) );\n    switch ( element.getRepositoryElementType() ) {\n      case DATABASE:\n        buf.append( RepositoryObjectType.DATABASE.getExtension() );\n        break;\n      case SLAVE_SERVER:\n        buf.append( RepositoryObjectType.SLAVE_SERVER.getExtension() );\n        break;\n      case CLUSTER_SCHEMA:\n        buf.append( RepositoryObjectType.CLUSTER_SCHEMA.getExtension() );\n        break;\n      case PARTITION_SCHEMA:\n        buf.append( RepositoryObjectType.PARTITION_SCHEMA.getExtension() );\n        break;\n      default:\n        throw new KettleException( \"It's not possible to rename Class [\" + element.getClass().getName()\n          + \"] to the repository\" );\n    }\n\n    readWriteLock.writeLock().lock();\n    try {\n      pur.moveFile( file.getId(), buf.toString(), null );\n    } finally {\n      readWriteLock.writeLock().unlock();\n    }\n  }\n\n  /**\n   * Use {@linkplain #saveKettleEntity} instead\n   */\n  @Deprecated\n  protected void saveJob0( RepositoryElementInterface element, String versionComment,\n                           boolean saveSharedObjects,\n                           boolean checkLock, boolean checkRename,","sourceCodeStart":2248,"sourceCodeEnd":2284,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java#L2248-L2284","documentation":"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.","triggerScenarios":"Calling PurRepository.rename(ObjectId, RepositoryElementInterface, newTitle, comments, calendar) with an element type not handled (e.g. a custom or security element).","commonSituations":"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.","solutions":["Rename only supported element types (transformations, jobs, databases, cluster/partition schemas)","Use dedicated APIs for renaming unsupported objects (e.g. user management)","Verify element.getRepositoryElementType() before renaming"],"exampleFix":"// before\nrepository.rename(id, element, \"newName\", \"comment\", calendar); // element is unsupported type\n// after\nif (SUPPORTED_TYPES.contains(element.getRepositoryElementType())) {\n  repository.rename(id, element, \"newName\", \"comment\", calendar);\n}","handlingStrategy":"validation","validationCode":"if (element.getRepositoryElementType() == null) {\n  throw new IllegalArgumentException(\"Cannot rename: unknown repository element type\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  repository.rename(id, element, newTitle, comments, calendar);\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"not possible to rename Class\")) {\n    log.error(\"Rename unsupported for this element type\", e);\n  }\n}","preventionTips":["Rename only supported types via generic rename","Use dedicated APIs for users/roles","Validate element type before renaming"],"tags":["pentaho","kettle","unsupported-type","rename"],"backgroundTag":"unsupported-operation","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}