{"record":{"id":"456b9eaf77a29196","repo":"apache/pulsar","slug":"e-getmessage-456b9e","errorCode":null,"errorMessage":"${e.getMessage()}","messagePattern":"\\$\\{e\\.getMessage\\(\\)\\}","errorType":"exception","errorClass":"org.apache.pulsar.client.impl.v5.PulsarClientException","httpStatus":null,"severity":"error","filePath":"pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/PulsarClientProviderV5.java","lineNumber":197,"sourceCode":"    }\n\n    @Override\n    public Authentication authenticationToken(Supplier<String> tokenSupplier) {\n        return new TokenAuthenticationV5(tokenSupplier);\n    }\n\n    @Override\n    public Authentication authenticationTls() {\n        return new TlsAuthentication();\n    }\n\n    @Override\n    public Authentication createAuthentication(String className, String params)\n            throws PulsarClientException {\n        try {\n            return V5AuthenticationLoader.create(className, params);\n        } catch (org.apache.pulsar.client.api.PulsarClientException e) {\n            throw new PulsarClientException(e.getMessage(), e);\n        }\n    }\n\n    @Override\n    public Authentication createAuthentication(String className, Map<String, String> params)\n            throws PulsarClientException {\n        try {\n            return V5AuthenticationLoader.create(className, params);\n        } catch (org.apache.pulsar.client.api.PulsarClientException e) {\n            throw new PulsarClientException(e.getMessage(), e);\n        }\n    }\n}\n","sourceCodeStart":179,"sourceCodeEnd":211,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/PulsarClientProviderV5.java#L179-L211","documentation":"createAuthentication(String className, String params) delegates to V5AuthenticationLoader.create; if the loader cannot instantiate the requested authentication plugin (unknown class name, missing plugin on classpath, or invalid params), it throws a PulsarClientException which is re-thrown here with the loader's original message and cause preserved. The message text is dynamic — it is whatever the underlying loader failure reported.","triggerScenarios":"Calling PulsarClientProviderV5.createAuthentication(className, params) where className does not match a registered/available authentication plugin, or the params string cannot be parsed by that plugin (e.g. malformed JSON or missing required fields like the role token or certificate path).","commonSituations":"Typo in the fully-qualified plugin class name; authentication plugin JAR not on the client classpath; passing params in the wrong format after migrating from an older client version; configuring OAuth2 or JWT auth with a missing key file path.","solutions":["Read the exception message/cause to see whether the plugin class was not found or the params were invalid","Verify the authentication plugin class name matches exactly what the loader supports (check V5AuthenticationLoader's supported names)","Ensure the plugin JAR is on the client classpath and the params string is valid for that plugin"],"exampleFix":"// before\nprovider.createAuthentication(\"org.apache.pulsar.AuthToken\", \"file:///missing/token\");\n// after\nprovider.createAuthentication(\"org.apache.pulsar.client.impl.auth.AuthenticationToken\",\n    \"file:///etc/pulsar/token.txt\");","handlingStrategy":"try-catch","validationCode":"if (className == null || className.isBlank()) throw new IllegalArgumentException(\"auth className required\");\nif (params == null || params.isBlank()) throw new IllegalArgumentException(\"auth params required\");","typeGuard":null,"tryCatchPattern":"try {\n    Authentication auth = provider.createAuthentication(className, params);\n} catch (PulsarClientException e) {\n    log.error(\"Auth plugin load failed: {}\", e.getMessage(), e.getCause());\n}","preventionTips":["Copy the plugin class name from documentation and keep it in one constant","Confirm the auth plugin JAR is on the runtime classpath","Test auth setup at startup, not lazily on first connect"],"tags":["authentication","configuration","plugin"],"backgroundTag":"auth-plugin-load-failed","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}