欢迎您访问365答案网,请分享给你的朋友!
生活常识 学习资料

【Addressalreadyinuse:bind】

时间:2023-05-04

报错信息:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.alibaba.dubbo.spring.boot.DubboProviderAutoConfiguration': Invocation of init method failed; nested exception is com.alibaba.dubbo.rpc.RpcException: Fail to start server(url: dubbo://192.168.254.1:20880/com.hpower.springboot.service.StudentService?anyhost=true&application=h024-spb-dubbo-ssm-provider&bind.ip=192.168.254.1&bind.port=20880&channel.readonly.sent=true&codec=dubbo&dubbo=2.6.0&generic=false&heartbeat=60000&interface=com.hpower.springboot.service.StudentService&methods=queryStudentById&pid=16916&side=provider&timeout=15000×tamp=1644981716353) Failed to bind NettyServer on /192.168.254.1:20880, cause: Failed to bind to: /0.0.0.0:20880at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160) ~[spring-beans-5.3.15.jar:5.3.15]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440) ~[spring-beans-5.3.15.jar:5.3.15]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.3.15.jar:5.3.15]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.15.jar:5.3.15]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.15.jar:5.3.15]at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.15.jar:5.3.15]at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.15.jar:5.3.15]at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.15.jar:5.3.15]at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.15.jar:5.3.15]at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953) ~[spring-beans-5.3.15.jar:5.3.15]at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.15.jar:5.3.15]at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.15.jar:5.3.15]at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.3.jar:2.6.3]at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) [spring-boot-2.6.3.jar:2.6.3]at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:414) [spring-boot-2.6.3.jar:2.6.3]at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) [spring-boot-2.6.3.jar:2.6.3]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) [spring-boot-2.6.3.jar:2.6.3]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) [spring-boot-2.6.3.jar:2.6.3]at com.hpower.springboot.H024SpbDubboSsmProviderApplication.main(H024SpbDubboSsmProviderApplication.java:14) [classes/:na]Caused by: com.alibaba.dubbo.rpc.RpcException: Fail to start server(url: dubbo://192.168.254.1:20880/com.hpower.springboot.service.StudentService?anyhost=true&application=h024-spb-dubbo-ssm-provider&bind.ip=192.168.254.1&bind.port=20880&channel.readonly.sent=true&codec=dubbo&dubbo=2.6.0&generic=false&heartbeat=60000&interface=com.hpower.springboot.service.StudentService&methods=queryStudentById&pid=16916&side=provider&timeout=15000×tamp=1644981716353) Failed to bind NettyServer on /192.168.254.1:20880, cause: Failed to bind to: /0.0.0.0:20880at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.createServer(DubboProtocol.java:277) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.openServer(DubboProtocol.java:254) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.export(DubboProtocol.java:241) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:93) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:68) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.registry.integration.RegistryProtocol.doLocalExport(RegistryProtocol.java:181) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:121) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:91) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:66) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:505) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:357) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:316) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.config.ServiceConfig.export(ServiceConfig.java:215) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.spring.boot.DubboProviderAutoConfiguration.initProviderBean(DubboProviderAutoConfiguration.java:84) ~[dubbo-spring-boot-starter-2.0.0.jar:na]at com.alibaba.dubbo.spring.boot.DubboProviderAutoConfiguration.init(DubboProviderAutoConfiguration.java:45) ~[dubbo-spring-boot-starter-2.0.0.jar:na]at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_311]at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_311]at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_311]at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_311]at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389) ~[spring-beans-5.3.15.jar:5.3.15]at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$Lifecyclemetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333) ~[spring-beans-5.3.15.jar:5.3.15]at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157) ~[spring-beans-5.3.15.jar:5.3.15]..、18 common frames omittedCaused by: com.alibaba.dubbo.remoting.RemotingException: Failed to bind NettyServer on /192.168.254.1:20880, cause: Failed to bind to: /0.0.0.0:20880at com.alibaba.dubbo.remoting.transport.AbstractServer.(AbstractServer.java:68) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.remoting.transport.netty.NettyServer.(NettyServer.java:61) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.remoting.transport.netty.NettyTransporter.bind(NettyTransporter.java:31) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.remoting.Transporter$Adaptive.bind(Transporter$Adaptive.java) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.remoting.Transporters.bind(Transporters.java:56) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchanger.bind(HeaderExchanger.java:42) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.remoting.exchange.Exchangers.bind(Exchangers.java:70) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.createServer(DubboProtocol.java:275) ~[dubbo-2.6.0.jar:2.6.0]..、41 common frames omittedCaused by: org.jboss.netty.channel.ChannelException: Failed to bind to: /0.0.0.0:20880at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:303) ~[netty-3.2.5.Final.jar:na]at com.alibaba.dubbo.remoting.transport.netty.NettyServer.doOpen(NettyServer.java:92) ~[dubbo-2.6.0.jar:2.6.0]at com.alibaba.dubbo.remoting.transport.AbstractServer.(AbstractServer.java:63) ~[dubbo-2.6.0.jar:2.6.0]..、48 common frames omittedCaused by: java.net.BindException: Address already in use: bindat sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_311]at sun.nio.ch.Net.bind(Net.java:438) ~[na:1.8.0_311]at sun.nio.ch.Net.bind(Net.java:430) ~[na:1.8.0_311]at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:225) ~[na:1.8.0_311]at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.8.0_311]at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.bind(NioServerSocketPipelineSink.java:148) ~[netty-3.2.5.Final.jar:na]at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleServerSocket(NioServerSocketPipelineSink.java:100) ~[netty-3.2.5.Final.jar:na]at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:74) ~[netty-3.2.5.Final.jar:na]at org.jboss.netty.channel.Channels.bind(Channels.java:468) ~[netty-3.2.5.Final.jar:na]at org.jboss.netty.channel.AbstractChannel.bind(AbstractChannel.java:192) ~[netty-3.2.5.Final.jar:na]at org.jboss.netty.bootstrap.ServerBootstrap$Binder.channelOpen(ServerBootstrap.java:348) ~[netty-3.2.5.Final.jar:na]at org.jboss.netty.channel.Channels.fireChannelOpen(Channels.java:176) ~[netty-3.2.5.Final.jar:na]at org.jboss.netty.channel.socket.nio.NioServerSocketChannel.(NioServerSocketChannel.java:85) ~[netty-3.2.5.Final.jar:na]at org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory.newChannel(NioServerSocketChannelFactory.java:142) ~[netty-3.2.5.Final.jar:na]at org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory.newChannel(NioServerSocketChannelFactory.java:90) ~[netty-3.2.5.Final.jar:na]at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:282) ~[netty-3.2.5.Final.jar:na]..、50 common frames omitted

报错如上,还是老问题,端口被占用了
zookeeper一般默认为2181 端口
win+r----->cmd----->执行 netstat -ano | findstr 2181 命令
查看2181端口是否已经被占用
ps:冒号后边的为端口号,找到最右列的数字(PID),打开任务管理器---->任务详情
如图,然后将相应的PID结束任务即可

Copyright © 2016-2020 www.365daan.com All Rights Reserved. 365答案网 版权所有 备案号:

部分内容来自互联网,版权归原作者所有,如有冒犯请联系我们,我们将在三个工作时内妥善处理。