启动Tomcat闪退 java.net.BindException: Address already in use: JVM_Bind

启动Tomcat闪退 java.net.BindException: Address already in use: JVM_Bind

问题:因为需求,需要将另一个tomcat上的项目迁移到另一个tomcat上,部署完毕之后启动tomcat闪退,查看catalina日志,查看报错信息

04-Jan-2021 16:42:02.408 严重 [main] org.apache.catalina.core.StandardServer.await Failed to create server shutdown socket on address [localhost] and port [8006] (base port [8006] and offset [0])
	java.net.BindException: Address already in use: JVM_Bind
		at java.net.DualStackPlainSocketImpl.bind0(Native Method)
		at java.net.DualStackPlainSocketImpl.socketBind(DualStackPlainSocketImpl.java:106)
		at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
		at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:190)
		at java.net.ServerSocket.bind(ServerSocket.java:375)
		at java.net.ServerSocket.<init>(ServerSocket.java:237)
		at org.apache.catalina.core.StandardServer.await(StandardServer.java:584)
		at org.apache.catalina.startup.Catalina.await(Catalina.java:721)
		at org.apache.catalina.startup.Catalina.start(Catalina.java:667)
		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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:344)
		at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475)

解决: 再看报错信息,初步怀疑是端口占用,但是在部署新的tomcat时,已经在server.xml中修改过tomcat端口,网上搜索问题端口被占用描述的是java.net.BindException: Address already in use: JVM_Bind+(端口),但是如上错误并没有显示被占用的端口;然后发现是因为我是直接复制的上一个项目的tomcat,虽然修改了端口,但是还是不行;最后重新解压一个tomcat即可。

你可能感兴趣的:(error,tomcat)