Tomcat启动一段时间后(报错+自动关闭)

如果:环境变量配置好了+端口没有被占用+防火墙关闭
【Tomcat启动一段时间后(报错+自动关闭)】org.apache.catalina.core.StandardServer.await StandardServer.await: create[localhost:8005]:
java.net.SocketException: Unrecognized Windows Sockets error: 10106: create
at java.net.ServerSocket.createImpl(ServerSocket.java:308)
at java.net.ServerSocket.getImpl(ServerSocket.java:257)
at java.net.ServerSocket.bind(ServerSocket.java:376)
at java.net.ServerSocket.(ServerSocket.java:237)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:438)
at org.apache.catalina.startup.Catalina.await(Catalina.java:718)
at org.apache.catalina.startup.Catalina.start(Catalina.java:664)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
那就试试这个:系统管理员身份运行cmd 输入:netsh winsock reset 然后重启电脑。
借鉴出处:https://blog.csdn.net/barry0022/article/details/78716693
自己弄了好久才成功,谢谢这位博主,解决了我的问题。

    推荐阅读