You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "chennaji9 (via GitHub)" <gi...@apache.org> on 2026/09/30 09:57:19 UTC

[I] [Bug] MessageStoreFactory reports every plugin initialization failure as "class not found" [rocketmq]

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: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org