spring boot中使用dubbo出现异常java.lang.IllegalStateException: <dubbo:service interface="" /> interface not allow null!

今天我在闲的时候,自己在springBoot中使用dubbo的时候,启动的时候,发现启动失败,报java.lang.IllegalStateException: <dubbo:service interface="" /> interface not allow null! 这个异常。我首先看了是否连接了zookeeper,是否使用了dubbo相关的service注解,在主程序的启动类上面是否使用了相关的dubbo注解。

以上问题都查询了一遍后,发现并没有问题。后来突然发现报的异常叫做 interface not allow null! ,突然想起来我使用的时候

@com.alibaba.dubbo.config.annotation.Service(interfaceClass = DictionaryTypeServiceImpl.class)

发现是我的interfaceClass属性指向的是接口的实现类,修改成接口@com.alibaba.dubbo.config.annotation.Service(interfaceClass = DictionaryTypeService.class) 之后使用正常。

猜你喜欢

转载自www.cnblogs.com/rensheng/p/9960759.html