interface not allow null!" type="hidden"/>

spring boot中使用dubbo出现异常java.lang.IllegalStateException: 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) 之后使用正常。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM