Tomcat启动后仍报404错误,Eclipse NEON重启后故障求助
Hey there, let's work through this 404 issue step by step—since everything ran smoothly before Eclipse crashed and you restarted it, this is almost certainly a configuration glitch rather than a core code problem. Here are the most practical fixes I'd try first:
Double-check project deployment status in Eclipse
Open the Servers view in Eclipse, right-click your Tomcat 8.5 instance, and selectAdd and Remove.... Make sure your project is listed under Configured—sometimes Eclipse drops deployed projects unexpectedly after a forced restart. If it's only in Available, move it over and restart Tomcat.Verify port 8080 isn't being used by another process
Forced restarts can leave old Tomcat instances running in the background, hogging port 8080.- On Windows: Open Command Prompt and run
netstat -ano | findstr :8080to find the process ID (PID) using the port, then open Task Manager to end that process. - On Mac/Linux: Run
lsof -i :8080in terminal, then kill the process withkill <PID>.
Once the port is free, restart Tomcat.
- On Windows: Open Command Prompt and run
Confirm context root and deployment path
Right-click your Tomcat instance →Properties→Web Module Settings.- Check that the Context Root matches the URL you're using to access your app (e.g., if your context root is
/my-project, you need to visithttp://localhost:8080/my-project, not just the rootlocalhost:8080). - Ensure the Document Base points to your project's
WebContentfolder (orsrc/main/webappif it's a Maven project)—SVN re-downloads sometimes mess up path mappings.
- Check that the Context Root matches the URL you're using to access your app (e.g., if your context root is
Dig into Tomcat logs for clues
Head to your Tomcat installation'slogsfolder and check these files:localhost.log: Logs app-specific startup errorscatalina.out(Mac/Linux) orcatalina.log(Windows): Shows Tomcat-wide deployment issues
If you see errors like "Context initialization failed" or missing dependencies, that's a clear sign your app isn't deploying properly, which causes the 404.
Clear caches and rebuild
- In Eclipse, go to
Project→Clean..., select your project, and let it rebuild. - Right-click Tomcat →
Clean...to wipe Tomcat's temporary deployment files. - Manually delete the
workfolder in your Tomcat installation directory—this clears cached class files that might be corrupted.
- In Eclipse, go to
Ensure your SVN project is fully intact
Even after re-downloading, sometimes files go missing:- Check
WEB-INF/libfor all required JAR files. - If it's a Maven project, run
mvn clean installin terminal to recompile and pull dependencies.
- Check
内容的提问来源于stack exchange,提问作者Kondziowsky

