码迷,mamicode.com
首页 > 其他好文 > 详细

日常记录,记下来自己的遇到的问题

时间:2018-08-08 17:40:41      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:一个   ace   tchar   apt   时间   dubbo   注入   char   interface   

2018-08-08

一个 spring boot 集合 dubbo 项目,在运行的时候报了这样子的一个错:

java.lang.IllegalArgumentException: @Service interfaceClass() or interfaceName() or interface class must be present!

我查找了很长时间,也没找到答案,最后只能自己查代码喽,发现这行代码的返回值为 null

Class<?>[] allInterfaces = annotatedServiceBeanClass.getInterfaces();

最后是因为代码中 @Service 修饰的类没直接继承接口,而是他的父类继承了接口,接着 dubbo 报错了,是因为 dubbo 进行接口注入的时候,必须直接实现接口

下面是具体的代码结构

//  接口
public interface IRedisService
//  实现接口的父类
public class BaseRedisServiceImpl implements IRedisService

 //  子类之前没后面的implement

 @Service(version="1.0", group="redis_jcaptcha")
 public class CaptchaRedisServiceImpl extends BaseRedisServiceImpl implements IRedisService

 

日常记录,记下来自己的遇到的问题

标签:一个   ace   tchar   apt   时间   dubbo   注入   char   interface   

原文地址:https://www.cnblogs.com/season1992/p/9443933.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!