消费端代码:
@EnableAutoConfiguration
public class DubboConsumerBootstrap {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Reference()
private DemoService demoService;
public static void main(String[] args) {
SpringApplication.run(DubboConsumerBootstrap.class).close();
}
@Bean
public ApplicationRunner runner() {
return args -> logger.info(demoService.sayHello("mercyblitz"));
}
}
报错:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dubboConsumerBootstrap': Injection of @org.apache.dubbo.config.annotation.Reference dependencies is failed; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.dubbo.example.DemoService. No provider available for the service com.dubbo.example.DemoService from the url zookeeper://127.0.0.1:2181/org.apache.dubbo.registry.RegistryService?application=consumer&dubbo=2.0.2&interface=com.dubbo.example.DemoService&lazy=false&methods=sayHello&pid=18132&qos-enable=false®ister.ip=192.168.93.1&release=2.7.2&side=consumer&sticky=false×tamp=1562853955673 to the consumer 192.168.93.1 use dubbo version 2.7.2
at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.postProcessPropertyValues(Annotatio