chennaji9 opened a new issue, #11284:
URL: https://github.com/apache/rocketmq/issues/11284
### Description
`store/src/main/java/org/apache/rocketmq/store/plugin/MessageStoreFactory.java`
reports the wrong failure cause when a message-store plugin fails to initialize:
```java
try {
Class<AbstractPluginMessageStore> clazz =
(Class<AbstractPluginMessageStore>) Class.forName(pluginClass);
Constructor<AbstractPluginMessageStore> construct =
clazz.getConstructor(MessageStorePluginContext.class, MessageStore.class);
AbstractPluginMessageStore pluginMessageStore =
construct.newInstance(context, messageStore);
messageStore = pluginMessageStore;
} catch (Throwable e) {
throw new RuntimeException("Initialize plugin's class: " + pluginClass +
" not found!", e);
}
```
`Class.forName`, `getConstructor` and `newInstance` all share the single
`catch (Throwable)`, and every failure is wrapped as `"... not found!"`. When
the plugin class EXISTS but its constructor throws (misconfigured store, NPE in
plugin init, illegal constructor args), the top-level message still claims the
class was not found. The underlying cause is only visible if someone inspects
the chain, and the misleading message actively sends the operator looking for
classpath problems instead of the real failure.
### Expected behavior
The exception message should describe the actual failure phase rather than
hardcoding "not found" — e.g. `"Failed to initialize message store plugin:
<class>"` — while preserving the original cause.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]