luffyke commented on issue #52: service空指针
URL: 
https://github.com/apache/incubator-dubbo-spring-boot-project/issues/52#issuecomment-377949925
 
 
   @zeng54088
   
   错误关键日志:
   ```
   Caused by: java.lang.IllegalStateException: No such extension 
com.alibaba.dubbo.rpc.Protocol by name zookeeper
   ```
   
   你的代码
   ```
   @Reference(version = "1.0.0",
           application = "${dubbo.application.id}",
           url = "zookeeper://168.192.93.87:2182")
   private DemoService demoService;
   ```
   配置了zookeeper作为注册中心,不用再需要设置url。
   
   
   这是我的zk配置。
   ```
   ## RegistryConfig Bean
   dubbo.registry.id = my-registry
   dubbo.registry.address=zookeeper://127.0.0.1:2181
   dubbo.registry.client=curator
   ```
   
   DemoController
   ```
   @RestController
   public class DemoController {
   
       @Reference(version = "1.0.0",
               application = "${dubbo.application.id}"
       )
       private DemoService demoService;
   
       @RequestMapping("/sayHello")
       public String sayHello(@RequestParam String name) {
           return demoService.sayHello(name);
       }
   }
   ```
   
   你的日志贴好点,一大堆粗体的看的很晕。。

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to