關於 下面問題是因為(8005, 8080, 8009) 被原tomcat占用了。
Several ports (8005, 8080, 8009) required by Tomcat v9.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).
在使用eclipse新創建tomcat時server也使用了(8005, 8080, 8009),因此運行項目會報告以上錯誤。
解決方案簡單粗暴,把新創建的server的端口都修改了。找到空間下的server.xml(E:\eclipse-workspace\Servers\Tomcat v9.0 Server at localhost-config\server.xml),查找到8005, 8080, 8009改成自己想的端口。也可以eclipse里修改,在如下圖8005, 8080為8006,8081,8009沒有截圖出來,大家可以按ctrl+f5查找。改完后,運行就不會再報以上的錯誤了。