关于Failed to check the status of the service com.taotao.service.ItemService. No provider available fo

简介: 原文:http://www.bubuko.com/infodetail-2250226.html项目中用dubbo发生:    Failed to check the status of the service com.taotao.service.ItemService. No provider available for the service原因:Dubbo缺省会在启动时检查依赖的服务是否可用,不可用时会抛出异常,阻止Spring初始化完成,以便上线时,能及早发现问题,默认check=true。

原文:http://www.bubuko.com/infodetail-2250226.html

项目中用dubbo发生:

    Failed to check the status of the service com.taotao.service.ItemService. No provider available for the service

原因:

Dubbo缺省会在启动时检查依赖的服务是否可用,不可用时会抛出异常,阻止Spring初始化完成,以便上线时,能及早发现问题,默认check=true。

如果你的Spring容器是懒加载的,或者通过API编程延迟引用服务,请关闭check,否则服务临时不可用时,会抛出异常,拿到null引用,如果check=false,总是会返回引用,当服务恢复时,能自动连上。

可以通过check="false"关闭检查,比如,测试时,有些服务不关心,或者出现了循环依赖,必须有一方先启动。

 

1、关闭某个服务的启动时检查:(没有提供者时报错)
<dubbo:reference interface="com.foo.BarService" check="false" /> 2、关闭所有服务的启动时检查:(没有提供者时报错) 写在定义服务消费者一方 <dubbo:consumer check="false" /> 3、关闭注册中心启动时检查:(注册订阅失败时报错) <dubbo:registry check="false" />
相关文章
|
6月前
|
监控
什么是 Service Ticket 的 Service Level Agreement
什么是 Service Ticket 的 Service Level Agreement
63 0
|
4月前
|
Kubernetes Docker 容器
Job for docker.service failed because the control process exited with error code.
Job for docker.service failed because the control process exited with error code.
51 0
|
25天前
|
Shell
etcd.service: main process exited, code=exited, status=203/EXEC
etcd.service: main process exited, code=exited, status=203/EXEC
24 1
|
5月前
|
Java
解决:Config service failed to start in 120 seconds! Please check ./service/apollo-service.log...
解决:Config service failed to start in 120 seconds! Please check ./service/apollo-service.log...
56 0
|
10月前
|
Android开发
Error connecting to the service protocol failed to connect to错误
Error connecting to the service protocol failed to connect to错误
|
11月前
|
网络协议
Job for named.service failed because the control process exited with error code.
Job for named.service failed because the control process exited with error code.
510 0
|
XML 应用服务中间件 数据格式
控制台报错: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting proper
控制台报错: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting proper
78 0
控制台报错: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting proper
|
Kubernetes 容器
k8s报错:Error from server (NotFound): the server could not find the requested resource (get services h
k8s报错:Error from server (NotFound): the server could not find the requested resource (get services h
openstack报错——MainPID=0 Id=neutron-server.service ActiveState=failed
openstack报错——MainPID=0 Id=neutron-server.service ActiveState=failed
339 0
openstack报错——MainPID=0 Id=neutron-server.service ActiveState=failed
|
关系型数据库 MySQL Java
解决方案 --Failed to initialize JPA EntityManagerFactory: Unable to create requested service
解决方案 --Failed to initialize JPA EntityManagerFactory: Unable to create requested service
解决方案 --Failed to initialize JPA EntityManagerFactory: Unable to create requested service