错误提示:
严重: Error starting endpoint
java.io.IOException: Unable to establish loopback connection
at sun.nio.ch.PipeImplInitializer.run(PipeImpl.java:106)atjava.security.AccessController.doPrivileged(NativeMethod)atsun.nio.ch.PipeImpl.<init>(PipeImpl.java:122)atsun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27)atjava.nio.channels.Pipe.open(Pipe.java:133)atsun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:104)atsun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:26)atjava.nio.channels.Selector.open(Selector.java:209)atorg.apache.tomcat.util.net.NioEndpoint Initializer.run(PipeImpl.java:106) at java.security.AccessController.doPrivileged(Native Method) at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:122) at sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27) at java.nio.channels.Pipe.open(Pipe.java:133) at sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:104) at sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:26) at java.nio.channels.Selector.open(Selector.java:209) at org.apache.tomcat.util.net.NioEndpointInitializer.run(PipeImpl.java:106)atjava.security.AccessController.doPrivileged(NativeMethod)atsun.nio.ch.PipeImpl.<init>(PipeImpl.java:122)atsun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27)atjava.nio.channels.Pipe.open(Pipe.java:133)atsun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:104)atsun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:26)atjava.nio.channels.Selector.open(Selector.java:209)atorg.apache.tomcat.util.net.NioEndpointPoller.(NioEndpoint.java:1472)
at org.apache.tomcat.util.net.NioEndpoint.start(NioEndpoint.java:929)
at org.apache.coyote.http11.Http11NioProtocol.start(Http11NioProtocol.java:168)
at org.apache.catalina.connector.Connector.start(Connector.java:1220)
at org.apache.catalina.core.StandardService.start(StandardService.java:540)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:759)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.net.SocketException: No buffer space available (maximum connections reached?): connect
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:532)
at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:78)
… 20 more
2018-8-20 10:00:21 org.apache.catalina.core.Sta
这是部分报错信息,前面还有一大串此处省略。
解决思路:
这个问题困扰了我很久,tomcat一启动,就开始报这个错。导致网站也访问不了。网上很多人说关闭防火墙什么的,重装jdk什么的都试过,没用。其实认真看一下报错日志,说的是:No buffer space available 想想应该是window中有什么大的链接没有关闭导致空间不足。查一查,果然,进程都结束了,依然后很多TIME_WAIT状态的连接未释放,再查看所有的time_wait连接。
解决过程:
1.cmd—>regedit 进入注册表
2.进入 HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters
3.新建 DWORD 类型的注册表项,命名为:MaxUserPort
4.值数据(双击MaxUserPort提示输入值): 60000(用十进制的格式录入进去,此值的有效范围为5000-65534)
5.新建 DWORD 类型的注册表项,命名为:TCPTimedWaitDelay
6.值数据: 30(TIME_WAIT的自动断开时间,默认为4分钟);
通过以上几步操作,重新启动tomcat。问题不复现,开心!!!!
结论:
由于大量的TIME_WAIT连接未被释放,导致占用的端口资源一直未被回收,出现了缓冲区空间不足的问题,应用也总是自动断线。
————————————————
版权声明:本文为CSDN博主「Pkor_Wu」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_42301806/article/details/85099224