springboot引入dubbo后在controller中用Reference注入服务引用时null问题解决

1 在consumer.xml中增加dubbo的annotation扫描

<dubbo:annotation package="com.test.controller" />

2 在依赖文件中增加:

<dependency>
  <groupId>com.alibaba.spring</groupId>
  <artifactId>spring-context-support</artifactId>
  <version>1.0.2</version>
</dependency>

猜你喜欢

转载自blog.csdn.net/lsb2002/article/details/87946225#comments_26629299