{"record":{"id":"be10002cc3da457b","repo":"pentaho/pentaho-kettle","slug":"unable-to-find-plugin-with-id-encoderpluginid-if-this-is-a","errorCode":null,"errorMessage":"Unable to find plugin with ID '\" + encoderPluginId + \"'.  If this is a test, make sure kettle-core tests jar is a dependency.  If this is live make sure a kettle-password-encoder-plugins.xml exits in the classpath","messagePattern":"Unable to find plugin with ID '\" \\+ encoderPluginId \\+ \"'\\.  If this is a test, make sure kettle-core tests jar is a dependency\\.  If this is live make sure a kettle-password-encoder-plugins\\.xml exits in the classpath","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/encryption/Encr.java","lineNumber":53,"sourceCode":"\n  private static TwoWayPasswordEncoderInterface encoder;\n\n  public Encr() {\n  }\n\n  @Deprecated\n  public boolean init() {\n    return true;\n  }\n\n  public static void init( String encoderPluginId ) throws KettleException {\n    if ( Utils.isEmpty( encoderPluginId ) ) {\n      throw new KettleException( \"Unable to initialize the two way password encoder: No encoder plugin type specified.\" );\n    }\n    PluginRegistry registry = PluginRegistry.getInstance();\n    PluginInterface plugin = registry.findPluginWithId( TwoWayPasswordEncoderPluginType.class, encoderPluginId );\n    if ( plugin == null ) {\n      throw new KettleException( \"Unable to find plugin with ID '\" + encoderPluginId + \"'.  If this is a test, make sure\"\n        + \" kettle-core tests jar is a dependency.  If this is live make sure a kettle-password-encoder-plugins.xml\"\n        + \" exits in the classpath\" );\n    }\n    encoder = (TwoWayPasswordEncoderInterface) registry.loadClass( plugin );\n\n    // Load encoder specific options...\n    //\n    try {\n      encoder.init();\n    } catch ( PasswordEncoderException e ) {\n      throw new KettleException( e );\n    }\n  }\n\n  /**\n   * Old signature code, used in license keys, from the Kettle 1.x days.\n   * @param signature\n   * @param verify","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/encryption/Encr.java#L35-L71","documentation":"Encr.init(encoderPluginId) throws KettleException when the PluginRegistry cannot find a TwoWayPasswordEncoderPluginType plugin with the given id, with a message explaining that kettle-core tests jar or a kettle-password-encoder-plugins.xml on the classpath provides the plugins. The registry loaded fine but no plugin matches encoderPluginId.","triggerScenarios":"Calling Encr.init(\"some-id\") where some-id is not registered: typo'd plugin id, missing kettle-password-encoder-plugins.xml on the classpath, or running tests without the kettle-core test plugins registered.","commonSituations":"Unit tests calling Encr without KettleEnvironment.init() and without the tests jar dependency; custom deployments that removed the password encoder plugin XML; renamed plugin ids across Kettle versions.","solutions":["Use the standard id \"kettle\" unless a custom encoder is intended.","Ensure kettle-password-encoder-plugins.xml exists on the classpath (it ships in kettle-core) and lists the requested id.","For tests, add the kettle-core tests jar dependency or call KettleEnvironment.init(true).","Verify with PluginRegistry.getInstance().findPluginWithId(TwoWayPasswordEncoderPluginType.class, id) != null before init."],"exampleFix":"// before (pom.xml) — tests jar missing\n<dependency><groupId>org.pentaho.di</groupId><artifactId>kettle-core</artifactId><version>...</version></dependency>\n// after\n<dependency><groupId>org.pentaho.di</groupId><artifactId>kettle-core</artifactId><version>...</version><classifier>tests</classifier><scope>test</scope></dependency>","handlingStrategy":"validation","validationCode":"PluginInterface p = PluginRegistry.getInstance()\n  .findPluginWithId( TwoWayPasswordEncoderPluginType.class, \"kettle\" );\nif ( p == null ) throw new IllegalStateException( \"Password encoder plugin not on classpath\" );\nEncr.init( \"kettle\" );","typeGuard":null,"tryCatchPattern":"try {\n  Encr.init( encoderPluginId );\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"Unable to find plugin with ID\" ) ) {\n    throw new IllegalStateException( \"Encoder plugin missing; add kettle-password-encoder-plugins.xml / tests jar to classpath\", e );\n  }\n  throw e;\n}","preventionTips":["Prefer KettleEnvironment.init() over manual Encr.init","Keep kettle-password-encoder-plugins.xml on the classpath","Add the kettle-core tests classifier for unit tests that need plugins","Use the standard 'kettle' plugin id unless a custom encoder is required"],"tags":["encryption","plugin","classpath","missing-dependency"],"backgroundTag":"missing-dependency","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"}