JDK 配置正確,startup.bat 閃過無報錯,但瀏覽器訪問 https://localhost:8080 或項目頁面均 404。
netstat -ano | findstr 8080,若被佔用(常見 8080 被 Oracle、其他 Tomcat 占用),修改 conf/server.xml 中 <Connector port="8081" .../>,重啟驗證。webapps/ROOT 下是否有 index.jsp?webapps/項目名 或通過 Context docBase 指定?logs/catalina.out 或 localhost.yyyy-mm-dd.log 搜索 SEVERE、ERROR 關鍵字。https://localhost:8080/manager/html(需配置 tomcat-users.xml),查看應用狀態是否為「Running」。修改端口後,瀏覽器訪問 https://localhost:新端口,若出現 Tomcat 貓首頁,說明容器正常,問題在項目部署;繼續檢查 web.xml、Controller 映射路徑。
端口衝突是 404 高發誘因,改端口、看日志、驗證部署,三步定位。