pentaho/pentaho-kettle · error · UnsupportedOperationException

Use getConverter

Error message

Use getConverter

What it means

ContentConverterHandler deliberately rejects the bulk getConverters() API inherited from its interface/parent. Converter lookup must go through getConverter(String), so the plural accessor is intentionally unimplemented to force callers onto the single-converter path.

Solutions

  1. Replace the getConverters() call with getConverter(String extension) for the specific extension you need
  2. If you must enumerate, query the individual extensions you know (ktr, kjb, etc.) one by one via getConverter
  3. Update custom calling code to the single-converter API supported by this handler

Example fix

// before
Map<String, Converter> all = handler.getConverters();
// after
Converter conv = handler.getConverter( "ktr" );
Defensive patterns

Strategy: try-catch

Validate before calling

// Prefer the supported API; avoid the bulk accessor
Converter conv = handler.getConverter( extension );
boolean bulkUsed = false; // never call getConverters()

Type guard

boolean supportsBulkListing( ContentConverterHandler h ) {
  return false; // contract: bulk listing is intentionally unsupported
}

Try / catch

try {
  Map<String, Converter> m = handler.getConverters();
} catch ( UnsupportedOperationException e ) {
  Converter c = handler.getConverter( extension ); // fall back to single lookup
}

Prevention

When it happens

Trigger: Calling getConverters() on a ContentConverterHandler instance, typically via framework code (e.g. Apache VFS content-handling or repository file resolution) that iterates all registered converters.

Common situations: Upgrading Pentaho/VFS versions where calling code uses the old bulk-converter API; custom plugins enumerating converters; reflection-based code inspecting the handler.

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/72744e561770b93c. Report an issue: GitHub.

Appendix: source

Thrown at plugins/repo-vfs/repo-vfs-pur/src/main/java/org/pentaho/di/plugins/repofvs/pur/converter/ContentConverterHandler.java:51

    this.transConverter = new MetaConverter<>( objId -> repository.loadTransformation( objId, null ) );
    this.jobConverter = new MetaConverter<>( objId -> repository.loadJob( objId, null ) );
  }

  @Override
  public Converter getConverter( String extension ) {
    if ( extension == null ) {
      return simpleConverter;
    }
    return switch ( extension.toLowerCase() ) {
      case Const.STRING_JOB_DEFAULT_EXT -> jobConverter;
      case Const.STRING_TRANS_DEFAULT_EXT -> transConverter;
      default -> simpleConverter;
    };
  }

  @Override
  public Map<String, Converter> getConverters() {
    throw new UnsupportedOperationException( "Use getConverter" );
  }

  @Override
  public void addConverter( String extension, Converter converter ) {
    throw new UnsupportedOperationException( "Cannot add converters" );
  }


}

View on GitHub (pinned to f3058517a1)