天天看点

解决 dubbo启动服务找不到实际存在的类报错

1、Field ***  could not be found.

解决 dubbo启动服务找不到实际存在的类报错

原因:dubbo没注册

解决办法:

(1)在dubboService.xml中配置

<dubbo:service ref="iUserApi" inter />
           

(2) 在dubbo-consumer.xml中配置

<dubbo:reference id="iUserApi" inter />
           

2、A component required a bean named 'iUserApi' that could not be found.

原因:未在接口实现类Service注解加上参数

解决方法:在接口实现类加上 @Service("userService")

@Service("userService")
public class UserServiceImpl implements UserService {