I was trying to get to work an apache tomcat 9.0.97 with java openjdk-11.0.25+9 and everything seemed to be fine. After someone else modified something I noticed that the server goes at an infinite loop when booting. To troubleshoot that I removed all war files and added folders in the webapp and then started the server tailing the catalina.out. I can see this severe error
SEVERE [main] org.apache.catalina.core.StandardServer.await Failed to create server shutdown socket on address [localhost] and port [8005] (base port [8005] and offset [0])
java.net.BindException: Address already in use (Bind failed)
at java.base/java.net.PlainSocketImpl.socketBind(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:452)
at java.base/java.net.ServerSocket.bind(ServerSocket.java:395)
at java.base/java.net.ServerSocket.<init>(ServerSocket.java:257)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:537)
at org.apache.catalina.startup.Catalina.await(Catalina.java:825)
at org.apache.catalina.startup.Catalina.start(Catalina.java:773)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
Do you have a solution for that.
ok the solution was to shutdown and kill every tomcat, then check every /opt/tomcat*/conf/server.xml and find the other one using that 8005 port for shutdown, then confiugre every tomcat to use a proper port different for each other.