kingkh1995 opened a new issue, #8613:
URL: https://github.com/apache/rocketmq/issues/8613

   ### Before Creating the Bug Report
   
   - [X] I found a bug, not just asking a question, which should be created in 
[GitHub Discussions](https://github.com/apache/rocketmq/discussions).
   
   - [X] I have searched the [GitHub 
Issues](https://github.com/apache/rocketmq/issues) and [GitHub 
Discussions](https://github.com/apache/rocketmq/discussions)  of this 
repository and believe that this is not a duplicate.
   
   - [X] I have confirmed that this bug belongs to the current repository, not 
other repositories of RocketMQ.
   
   
   ### Runtime platform environment
   
   windows11
   
   ### RocketMQ version
   
   develop
   
   ### JDK Version
   
   jdk8
   
   ### Describe the Bug
   
   AuthorizationFactory
   
   public static AuthorizationStrategy getStrategy(AuthConfig config, 
Supplier<?> metadataService) {
           try {
               Class<? extends AuthorizationStrategy> clazz = 
StatelessAuthorizationStrategy.class;
               if (StringUtils.isNotBlank(config.getAuthenticationStrategy())) 
{ // wrong
                   clazz = (Class<? extends AuthorizationStrategy>) 
Class.forName(config.getAuthorizationStrategy());
               }
               return clazz.getDeclaredConstructor(AuthConfig.class, 
Supplier.class).newInstance(config, metadataService);
           } catch (Exception e) {
               throw new RuntimeException(e);
           }
       }
   
   ### Steps to Reproduce
   
   broker.conf
   
   brokerClusterName = DefaultCluster
   brokerName = broker-a
   brokerId = 0
   deleteWhen = 04
   fileReservedTime = 48
   brokerRole = ASYNC_MASTER
   flushDiskType = ASYNC_FLUSH
   
   authenticationEnabled = true
   authenticationProvider = 
org.apache.rocketmq.auth.authentication.provider.DefaultAuthenticationProvider
   initAuthenticationUser = {"username":"rocketmq","password":"12345678"}
   innerClientAuthenticationCredentials = 
{"accessKey":"rocketmq","secretKey":"12345678"}
   authenticationMetadataProvider = 
org.apache.rocketmq.auth.authentication.provider.LocalAuthenticationMetadataProvider
   authenticationStrategy = 
org.apache.rocketmq.auth.authentication.strategy.StatefulAuthenticationStrategy
   
   ### What Did You Expect to See?
   
   start success
   
   ### What Did You See Instead?
   
   java.lang.RuntimeException: java.lang.RuntimeException: 
java.lang.NullPointerException
        at 
org.apache.rocketmq.broker.BrokerController.initialRequestPipeline(BrokerController.java:1064)
        at 
org.apache.rocketmq.broker.BrokerController.recoverAndInitService(BrokerController.java:882)
        at 
org.apache.rocketmq.broker.BrokerController.initialize(BrokerController.java:834)
        at 
org.apache.rocketmq.broker.BrokerStartup.createBrokerController(BrokerStartup.java:248)
        at 
org.apache.rocketmq.proxy.ProxyStartup.createBrokerController(ProxyStartup.java:230)
        at 
org.apache.rocketmq.proxy.ProxyStartup.createMessagingProcessor(ProxyStartup.java:188)
        at org.apache.rocketmq.proxy.ProxyStartup.main(ProxyStartup.java:79)
   Caused by: java.lang.RuntimeException: java.lang.NullPointerException
        at 
org.apache.rocketmq.auth.authorization.factory.AuthorizationFactory.getStrategy(AuthorizationFactory.java:113)
        at 
org.apache.rocketmq.auth.authorization.AuthorizationEvaluator.<init>(AuthorizationEvaluator.java:36)
        at 
org.apache.rocketmq.auth.authorization.AuthorizationEvaluator.<init>(AuthorizationEvaluator.java:32)
        at 
org.apache.rocketmq.auth.authorization.factory.AuthorizationFactory.lambda$getEvaluator$2(AuthorizationFactory.java:97)
        at 
org.apache.rocketmq.auth.authorization.factory.AuthorizationFactory.computeIfAbsent(AuthorizationFactory.java:147)
        at 
org.apache.rocketmq.auth.authorization.factory.AuthorizationFactory.getEvaluator(AuthorizationFactory.java:97)
        at 
org.apache.rocketmq.broker.auth.pipeline.AuthorizationPipeline.<init>(AuthorizationPipeline.java:43)
        at 
org.apache.rocketmq.broker.BrokerController.initialRequestPipeline(BrokerController.java:1060)
        ... 6 more
   Caused by: java.lang.NullPointerException
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at 
org.apache.rocketmq.auth.authorization.factory.AuthorizationFactory.getStrategy(AuthorizationFactory.java:109)
        ... 13 more
   
   ### Additional Context
   
   _No response_


-- 
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-unsubscr...@rocketmq.apache.org.apache.org

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

Reply via email to