luffyke commented on issue #52: service空指针
URL: 
https://github.com/apache/incubator-dubbo-spring-boot-project/issues/52#issuecomment-377949925
 
 
   @zeng54088
   
   Key error log:
   ```
   Caused by: java.lang.IllegalStateException: No such extension 
com.alibaba.dubbo.rpc.Protocol by name zookeeper
   ```
   
   Your code
   ```
   @Reference(version = "1.0.0",
           application = "${dubbo.application.id}",
           url = "zookeeper://168.192.93.87:2182")
   private DemoService demoService;
   ```
   No need to set url as config zookeeper as register center.
   
   
   This is my zk config:
   ```
   ## 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);
       }
   }
   ```
   
   Please attach log more beauty for convenient. 

----------------------------------------------------------------
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