V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
JYChiu
V2EX  ›  2019

Spring Boot 第一次配置 Dubbo 就报错,不知道怎么解决

  •  
  •   JYChiu · 2019-08-05 11:39:30 +08:00 · 3203 次点击
    这是一个创建于 1935 天前的主题,其中的信息可能已经有所发展或是发生改变。
    Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
    2019-08-05 11:30:08.462 ERROR 4435 --- [           main] o.s.boot.SpringApplication               : Application run failed
    
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'quickStartConsumer' defined in file [/Users/chiu/Documents/IdeaProjects/springboot_dubbo_zk/consumer/target/classes/com/xxx/consumer/QuickStart/QuickStartConsumer.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: quickStartConsumer; nested exception is com.alibaba.dubbo.rpc.RpcException: Fail to create remoting client for service(dubbo://127.0.0.1:20880/com.xxx.ServiceAPI?application=the-consumer&codec=dubbo&dubbo=2.6.0&heartbeat=60000&interface=com.xxx.ServiceAPI&methods=sendMessage&pid=4435&register.ip=192.168.124.4&side=consumer&timestamp=1564975808256): client(url: dubbo://127.0.0.1:20880/com.xxx.ServiceAPI?application=the-consumer&codec=dubbo&dubbo=2.6.0&heartbeat=60000&interface=com.xxx.ServiceAPI&methods=sendMessage&pid=4435&register.ip=192.168.124.4&side=consumer&timestamp=1564975808256) failed to connect to server /127.0.0.1:20880, error message is:Connection refused
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
        at com.xxx.consumer.ConsumerApp.main(ConsumerApp.java:15) [classes/:na]
    Caused by: org.springframework.beans.factory.BeanCreationException: quickStartConsumer; nested exception is com.alibaba.dubbo.rpc.RpcException: Fail to create remoting client for service(dubbo://127.0.0.1:20880/com.xxx.ServiceAPI?application=the-consumer&codec=dubbo&dubbo=2.6.0&heartbeat=60000&interface=com.xxx.ServiceAPI&methods=sendMessage&pid=4435&register.ip=192.168.124.4&side=consumer&timestamp=1564975808256): client(url: dubbo://127.0.0.1:20880/com.xxx.ServiceAPI?application=the-consumer&codec=dubbo&dubbo=2.6.0&heartbeat=60000&interface=com.xxx.ServiceAPI&methods=sendMessage&pid=4435&register.ip=192.168.124.4&side=consumer&timestamp=1564975808256) failed to connect to server /127.0.0.1:20880, error message is:Connection refused
        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:414) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1770) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
        ... 15 common frames omitted
    Caused by: com.alibaba.dubbo.rpc.RpcException: Fail to create remoting client for service(dubbo://127.0.0.1:20880/com.xxx.ServiceAPI?application=the-consumer&codec=dubbo&dubbo=2.6.0&heartbeat=60000&interface=com.xxx.ServiceAPI&methods=sendMessage&pid=4435&register.ip=192.168.124.4&side=consumer&timestamp=1564975808256): client(url: dubbo://127.0.0.1:20880/com.xxx.ServiceAPI?application=the-consumer&codec=dubbo&dubbo=2.6.0&heartbeat=60000&interface=com.xxx.ServiceAPI&methods=sendMessage&pid=4435&register.ip=192.168.124.4&side=consumer&timestamp=1564975808256) failed to connect to server /127.0.0.1:20880, error message is:Connection refused
        at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.initClient(DubboProtocol.java:404) ~[dubbo-2.6.0.jar:2.6.0]
        at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.getSharedClient(DubboProtocol.java:367) ~[dubbo-2.6.0.jar:2.6.0]
        at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.getClients(DubboProtocol.java:344) ~[dubbo-2.6.0.jar:2.6.0]
        at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.refer(DubboProtocol.java:326) ~[dubbo-2.6.0.jar:2.6.0]
        at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:77) ~[dubbo-2.6.0.jar:2.6.0]
        at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:100) ~[dubbo-2.6.0.jar:2.6.0]
        at com.alibaba.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java) ~[dubbo-2.6.0.jar:2.6.0]
        at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:394) ~[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
    Caused by: com.alibaba.dubbo.remoting.RemotingException: client(url: dubbo://127.0.0.1:20880/com.xxx.ServiceAPI?application=the-consumer&codec=dubbo&dubbo=2.6.0&heartbeat=60000&interface=com.xxx.ServiceAPI&methods=sendMessage&pid=4435&register.ip=192.168.124.4&side=consumer&timestamp=1564975808256) failed to connect to server /127.0.0.1:20880, error message is:Connection refused
        at com.alibaba.dubbo.remoting.transport.netty.NettyClient.doConnect(NettyClient.java:122) ~[dubbo-2.6.0.jar:2.6.0]
        at com.alibaba.dubbo.remoting.transport.AbstractClient.connect(AbstractClient.java:266) ~[dubbo-2.6.0.jar:2.6.0]
        at com.alibaba.dubbo.remoting.transport.AbstractClient.<init>(AbstractClient.java:89) ~[dubbo-2.6.0.jar:2.6.0]
        at com.alibaba.dubbo.remoting.transport.netty.NettyClient.<init>(NettyClient.java:59) ~[dubbo-2.6.0.jar:2.6.0]
        at com.alibaba.dubbo.remoting.transport.netty.NettyTransporter.connect(NettyTransporter.java:35) ~[dubbo-2.6.0.jar:2.6.0]
        at com.alibaba.dubbo.remoting.Transporter$Adaptive.connect(Transporter$Adaptive.java) ~[dubbo-2.6.0.jar:2.6.0]
        at com.alibaba.dubbo.remoting.Transporters.connect(Transporters.java:75) ~[dubbo-2.6.0.jar:2.6.0]
        at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchanger.connect(HeaderExchanger.java:38) ~[dubbo-2.6.0.jar:2.6.0]
        at com.alibaba.dubbo.remoting.exchange.Exchangers.connect(Exchangers.java:109) ~[dubbo-2.6.0.jar:2.6.0]
        at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.initClient(DubboProtocol.java:401) ~[dubbo-2.6.0.jar:2.6.0]
        ... 29 common frames omitted
    Caused by: java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.8.0_131]
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[na:1.8.0_131]
        at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.connect(NioClientSocketPipelineSink.java:384) ~[netty-3.2.5.Final.jar:na]
        at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processSelectedKeys(NioClientSocketPipelineSink.java:354) ~[netty-3.2.5.Final.jar:na]
        at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.run(NioClientSocketPipelineSink.java:276) ~[netty-3.2.5.Final.jar:na]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_131]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_131]
        at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_131]
    
    

    没有配置 ZooKeeper,纯粹是 Dubbo 的问题。

    第 1 条附言  ·  2019-08-05 12:14:37 +08:00
    对不起,因为启动 Consumer 的时候 Provider 关掉了,无视我吧😂
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2936 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 14:23 · PVG 22:23 · LAX 06:23 · JFK 09:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.