springboot整合dubbo启动遇到空指针异常

遇到的错误:

Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause

这个问题一般都是拦截器或者controller注解有问题,我在调用zookeeper注册中心的@Reference注解导错了包,应该是org.apache.dubbo.config.annotation.Reference

springboot整合dubbo启动遇到空指针异常

还要注意:服务器端的@Service 注解应该是导入org.apache.dubbo.config.annotation.Service这个包,客户端的@Service 则是org.springframework.stereotype.Service这个包,导错了包就会空指针。