老师 不知道为什么gateway又找不到服务了,但是明明我的服务都有在zookeeper里面

来源:4-8 JWT修改测试和总结

weixin_慕用7362611

2020-01-10

图片描述
老师我的zookeeper明明是有UserAPI,但是为什么还是报找不到错误
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘client’ defined in file [/Users/GreenArrow/Desktop/guns/guns-gateway/target/classes/com/stylefeng/guns/rest/modular/Client.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: client; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.stylefeng.guns.api.user.UserAPI. No provider available for the service com.stylefeng.guns.api.user.UserAPI from the url zookeeper://localhost:2181/com.alibaba.dubbo.registry.RegistryService?anyhost=true&application=Meeting-gateway&check=false&default.timeout=50000&dubbo=2.6.0&generic=false&interface=com.stylefeng.guns.api.user.UserAPI&methods=updateUserInfo,checkUsername,getUserInfo,login,register&pid=3337&register.ip=125.211.213.133&remote.timestamp=1578636579919&side=consumer&timeout=30000&timestamp=1578636708475 to the consumer 125.211.213.133 use dubbo version 2.6.0
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:587) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at com.stylefeng.guns.rest.GatewayApplication.main(GatewayApplication.java:12) [classes/:na]
Caused by: org.springframework.beans.factory.BeanCreationException: client; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.stylefeng.guns.api.user.UserAPI. No provider available for the service com.stylefeng.guns.api.user.UserAPI from the url zookeeper://localhost:2181/com.alibaba.dubbo.registry.RegistryService?anyhost=true&application=Meeting-gateway&check=false&default.timeout=50000&dubbo=2.6.0&generic=false&interface=com.stylefeng.guns.api.user.UserAPI&methods=updateUserInfo,checkUsername,getUserInfo,login,register&pid=3337&register.ip=125.211.213.133&remote.timestamp=1578636579919&side=consumer&timeout=30000&timestamp=1578636708475 to the consumer 125.211.213.133 use dubbo version 2.6.0
at com.alibaba.dubbo.spring.boot.DubboConsumerAutoConfiguration$1.postProcessBeforeInitialization(DubboConsumerAutoConfiguration.java:100) ~[dubbo-spring-boot-starter-2.0.0.jar:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:422) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1694) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:579) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
… 15 common frames omitted
Caused by: java.lang.IllegalStateException: Failed to check the status of the service com.stylefeng.guns.api.user.UserAPI. No provider available for the service com.stylefeng.guns.api.user.UserAPI from the url zookeeper://localhost:2181/com.alibaba.dubbo.registry.RegistryService?anyhost=true&application=Meeting-gateway&check=false&default.timeout=50000&dubbo=2.6.0&generic=false&interface=com.stylefeng.guns.api.user.UserAPI&methods=updateUserInfo,checkUsername,getUserInfo,login,register&pid=3337&register.ip=125.211.213.133&remote.timestamp=1578636579919&side=consumer&timeout=30000&timestamp=1578636708475 to the consumer 125.211.213.133 use dubbo version 2.6.0
at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:422) ~[dubbo-2.6.0.jar:2.6.0]
at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:333) ~[dubbo-2.6.0.jar:2.6.0]
at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:163) ~[dubbo-2.6.0.jar:2.6.0]
at com.alibaba.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:59) ~[dubbo-2.6.0.jar:2.6.0]
at com.alibaba.dubbo.spring.boot.DubboConsumerAutoConfiguration$1.postProcessBeforeInitialization(DubboConsumerAutoConfiguration.java:89) ~[dubbo-spring-boot-starter-2.0.0.jar:na]
… 18 common frames omitted

2020-01-10 14:11:52.209 INFO 3337 — [-localhost:2181] org.I0Itec.zkclient.ZkEventThread : Terminate ZkClient event thread.
2020-01-10 14:11:52.213 INFO 3337 — [tor-EventThread] org.apache.zookeeper.ClientCnxn : EventThread shut down for session: 0x16f8dcf8b7c000f
2020-01-10 14:11:52.213 INFO 3337 — [bboShutdownHook] org.apache.zookeeper.ZooKeeper : Session: 0x16f8dcf8b7c000f closed

Process finished with exit code 1

代码比较多,就放Git吧:
https://github.com/GreenArrow2017/Meeting
就是老师这一章的测试出的问题

写回答

1回答

Allen

2020-01-10

有试过直连看看么, 这个错误信息看不出问题的, 就是报了一个userapi不能用

0
5
weixin_慕用7362611
回复
Allen
是的 删掉了才行
2020-01-15
共5条回复

Dubbo主流版本打造仿猫眼项目 理解微服务核心思想

实战Dubbo项目+面试技巧,老司机带你畅游微服务

1410 学习 · 582 问题

查看课程