thinglinks broker启动报错netty Failed to bind on [0.0.0.0:端口]【已解决】

jian436 2022-07-11 15:22:05

原因是端口占用

 
thinglinks.mqttsnet.com 2022-07-11 15:17:12 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'startServer' defined in io.github.quickmsg.starter.AutoMqttConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.github.quickmsg.core.Bootstrap]: Factory method 'startServer' threw exception; nested exception is reactor.netty.ChannelBindException: Failed to bind on [0.0.0.0:11883]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
    at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:583)
    at org.springframework.context.support.AbstractApplicationContext.jrLockAndRefresh(AbstractApplicationContext.java:41002)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:42008)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)
    at com.mqttsnet.thinglinks.broker.ThingLinksBrokerApplication.main(ThingLinksBrokerApplication.java:28)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.github.quickmsg.core.Bootstrap]: Factory method 'startServer' threw exception; nested exception is reactor.netty.ChannelBindException: Failed to bind on [0.0.0.0:11883]
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
    ... 21 common frames omitted
Caused by: reactor.netty.ChannelBindException: Failed to bind on [0.0.0.0:11883]
    Suppressed: java.lang.Exception: #block terminated with an error
        at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:99)
        at reactor.core.publisher.Mono.block(Mono.java:1707)
        at io.github.quickmsg.starter.AutoMqttConfiguration.startServer(AutoMqttConfiguration.java:46)
        at io.github.quickmsg.starter.AutoMqttConfiguration$$EnhancerBySpringCGLIB$$1.CGLIB$startServer$0(<generated>)
        at io.github.quickmsg.starter.AutoMqttConfiguration$$EnhancerBySpringCGLIB$$1$$FastClassBySpringCGLIB$$1.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
        at io.github.quickmsg.starter.AutoMqttConfiguration$$EnhancerBySpringCGLIB$$1.startServer(<generated>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
        at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:583)
        at org.springframework.context.support.AbstractApplicationContext.jrLockAndRefresh(AbstractApplicationContext.java:41002)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:42008)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)
        at com.mqttsnet.thinglinks.broker.ThingLinksBrokerApplication.main(ThingLinksBrokerApplication.java:28)


...全文
524 2 打赏 收藏 举报
写回复
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
jian436 07-12
精选
  • 打赏
  • 举报
回复

windows
参考解决方法
https://qa.1r1g.cn/superuser/ask/110554251/

PS C:\Windows\system32> net stop winnat

Windows NAT Driver 服务已成功停止。

PS C:\Windows\system32> net stop LanmanWorkstation
下面的服务依赖于 Workstation 服务。
停止 Workstation 服务也会停止这些服务。

   Remote Desktop Configuration

你想继续此操作吗? (Y/N) [N]: y
Remote Desktop Configuration 服务正在停止.
Remote Desktop Configuration 服务已成功停止。

Workstation 服务正在停止.
Workstation 服务已成功停止。

PS C:\Windows\system32> net stop WlanSvc
WLAN AutoConfig 服务正在停止.
WLAN AutoConfig 服务已成功停止。

PS C:\Windows\system32> net stop WwanSvc
没有启动 WWAN AutoConfig 服务。

请键入 NET HELPMSG 3521 以获得更多的帮助。

PS C:\Windows\system32> netsh int ipv4 add excludedportrange protocol=tcp startport=11883 numberofports=1
确定。

PS C:\Windows\system32> netsh interface ipv4 show excludedportrange protocol=tcp

协议 tcp 端口排除范围

开始端口    结束端口
----------    --------
     11883       11883     *
     50000       50059     *

* - 管理的端口排除。
```bash


```

xiaonannet 07-11
  • 打赏
  • 举报
回复 1

端口占用问题

发帖
ThingLinks社区

303

社区成员

ThingLinks物联网一体化平台社区 版本将持续迭代更新,支持商业二开; 欢迎你分享物联网及平台相关技术文档;
物联网能源开源 企业社区
社区管理员
  • xiaonannet
  • jian436
  • 很久是多久
加入社区
帖子事件
编辑了帖子 (查看)
2022-07-14 17:43
编辑了帖子 (查看)
2022-07-12 15:21
创建了帖子
2022-07-11 15:22
社区公告

ThingLinks物联网一体化平台社区

https://gitee.com/mqttsnet/thinglinks

https://github.com/mqttsnet/thinglinks