您的位置:首页 > 大数据 > 人工智能

Dubbo: Failed to check the status of the service . No provider available for the service

2017-12-23 17:27 1416 查看
参考链接: http://blog.csdn.net/xlgen157387/article/details/52702659

分别将dubbo的provider和consumer部署到tomcat上面,先启动provider,启动成功,再启动consumer,报如下错误:

java.lang.IllegalStateException: Failed to check the status of the service com.unj.dubbotest.provider.DemoService. No provider available for the service com.unj.dubbotest.provider.DemoService from the url zookeeper


详细错误如下:

ype Exception report

message org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoService': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.unj.dubbotest.provider.DemoService. No provider available for the service com.unj.dubbotest.provider.DemoService from the url zookeeper://10.0.3.42:2181/com.alibaba.dubbo.registry.RegistryService?anyhost=true&application=hehe_consumer&check=false&default.timeout=30000&dubbo=2.5.4&generic=false&interface=com.unj.dubbotest.provider.DemoService&methods=getStr,sayHello,getUsers&pid=2821&side=consumer×tamp=1514020985135 to the consumer 0.0.23.54 use dubbo version 2.5.4

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoService': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.unj.dubbotest.provider.DemoService. No provider available for the service com.unj.dubbotest.provider.DemoService from the url zookeeper://10.0.3.42:2181/com.alibaba.dubbo.registry.RegistryService?anyhost=true&application=hehe_consumer&check=false&default.timeout=30000&dubbo=2.5.4&generic=false&interface=com.unj.dubbotest.provider.DemoService&methods=getStr,sayHello,getUsers&pid=2821&side=consumer×tamp=1514020985135 to the consumer 0.0.23.54 use dubbo version 2.5.4
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:561)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:477)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoService': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.unj.dubbotest.provider.DemoService. No provider available for the service com.unj.dubbotest.provider.DemoService from the url zookeeper://10.0.3.42:2181/com.alibaba.dubbo.registry.RegistryService?anyhost=true&application=hehe_consumer&check=false&default.timeout=30000&dubbo=2.5.4&generic=false&interface=com.unj.dubbotest.provider.DemoService&methods=getStr,sayHello,getUsers&pid=2821&side=consumer×tamp=1514020985135 to the consumer 0.0.23.54 use dubbo version 2.5.4
org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:127)
java.security.AccessController.doPrivileged(Native Method)
org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:116)
org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:91)
org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1288)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:217)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
com.alibaba.dubbo.demo.pp.Consumer.getName(Consumer.java:52)
org.apache.jsp.index_jsp._jspService(index_jsp.java:131)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause

java.lang.IllegalStateException: Failed to check the status of the service com.unj.dubbotest.provider.DemoService. No provider available for the service com.unj.dubbotest.provider.DemoService from the url zookeeper://10.0.3.42:2181/com.alibaba.dubbo.registry.RegistryService?anyhost=true&application=hehe_consumer&check=false&default.timeout=30000&dubbo=2.5.4&generic=false&interface=com.unj.dubbotest.provider.DemoService&methods=getStr,sayHello,getUsers&pid=2821&side=consumer×tamp=1514020985135 to the consumer 0.0.23.54 use dubbo version 2.5.4
com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:407)
com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:320)
com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:159)
com.alibaba.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:65)
org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:121)
java.security.AccessController.doPrivileged(Native Method)
org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:116)
org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:91)
org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1288)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:217)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
com.alibaba.dubbo.demo.pp.Consumer.getName(Consumer.java:52)
org.apache.jsp.index_jsp._jspService(index_jsp.java:131)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.73 logs.


问题原因是: 机名都指向了内网IP

解决方案是: 因此需要将他们改回具体的公网IP地址,或者直接删除

#1.2.3.4  5941
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐