springboot interface not allow null!

文章目录
  1. 1. 问题描述
  2. 2. 解决方法
  3. 3. 总结

测试用例执行的时候报这个错误,项目是 springboot 没有配置文件,检查一遍没发现什么问题,最后跟踪源码调试,发现问题所在

问题描述

Invocation of init method failed; nested exception is java.lang.IllegalStateException: dubbo:service interface interface not allow null!

1
@Service(interfaceClass = TSingleStoreOperationLogServiceImpl.class)

解决方法

实现层的注解类写错了,应该是接口而不是实现

1
@Service(interfaceClass = ITSingleStoreOperationLogService.class)

总结

这种错误看不出问题所在,不要着急,网上查找资料也是找不到问题所在,唯有通过报错的信息定位到 spring 的源码进行调试,才能定位到你的错误来源,缩小范围,才能快速解决问题!

评论