使用过程中遇到如下问题,因服务端启动后挂掉,客户端无法获取,解决方法是服务端一直都要活着:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bsCustomerService': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.baturu.login.service.BsCustomerService. No provider available for the service com.baturu.login.service.BsCustomerService from the url zookeeper://192.168.0.253:2181/com.alibaba.dubbo.registry.RegistryService?anyhost=true&application=consumer-of-login-service&check=false&connected=true&default.timeout=60000&dubbo=2.4.9&inside.invoker.count=1&inside.invokers=dubbo%3A%2F%2F192.168.0.12%3A20881%2Fcom.baturu.login.service.BsCustomerService%3Fanyhost%3Dtrue%26application%3Dlogin-service%26default.timeout%3D60000%26dubbo%3D2.4.9%26interface%3Dcom.baturu.login.service.BsCustomerService%26methods%3DverifyLogin%26pid%3D5540%26side%3Dprovider%26timestamp%3D1417242287804&interface=com.baturu.login.service.BsCustomerService&methods=verifyLogin&pid=6536&side=consumer×tamp=1417248855633 to the consumer 192.168.0.12 use dubbo version 2.4.9
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1468)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:249)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117)
at com.baturu.test.main.ServiceRun.initSysBeansOfContext(ServiceRun.java:36)
at com.baturu.test.main.ServiceRun.main(ServiceRun.java:20)
Caused by: java.lang.IllegalStateException: Failed to check the status of the service com.baturu.login.service.BsCustomerService. No provider available for the service com.baturu.login.service.BsCustomerService from the url zookeeper://192.168.0.253:2181/com.alibaba.dubbo.registry.RegistryService?anyhost=true&application=consumer-of-login-service&check=false&connected=true&default.timeout=60000&dubbo=2.4.9&inside.invoker.count=1&inside.invokers=dubbo%3A%2F%2F192.168.0.12%3A20881%2Fcom.baturu.login.service.BsCustomerService%3Fanyhost%3Dtrue%26application%3Dlogin-service%26default.timeout%3D60000%26dubbo%3D2.4.9%26interface%3Dcom.baturu.login.service.BsCustomerService%26methods%3DverifyLogin%26pid%3D5540%26side%3Dprovider%26timestamp%3D1417242287804&interface=com.baturu.login.service.BsCustomerService&methods=verifyLogin&pid=6536&side=consumer×tamp=1417248855633 to the consumer 192.168.0.12 use dubbo version 2.4.9
at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:422)
at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:303)
at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:138)
at com.alibaba.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:65)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
... 7 more