Solution to the problem that Tomcat reports 404 when accessing localhost normally

Solution to the problem that Tomcat reports 404 when accessing localhost normally

Today, when I was configuring Tomcat to access the project homepage, I found that it reported a 404 error. At first, I thought there was a problem with my project xml configuration. As a result, I adjusted it for a long time and it was still wrong. Later, I found that accessing localhost:8080 also reported a 404 error. This problem was serious, so I started a long debugging and finally succeeded! Record the final solution so that you can refer to it when you encounter similar problems in the future.

After consulting with the experts in the JAVA group, I checked the webapps folder in the Tomcat folder and found that my project was not in it, but I did deploy the project in it, so I checked my Tomcat server page and found that the Tomcat path in it was wrong. It was the default path in eclipse, so the deployment of Tomcat failed:

The incorrect path configuration is as follows:


The correct configuration should be:


But after I did this, I ran Tomcat again and found that it couldn't start up and reported an error that the file path could not be found !

Then I decided to change my idea. First, I did not use eclipse to start the Tomcat service. I used Tomcat8.0's startup.bat to start it. I found that an access denied error was reported during the startup process. I thought there was a problem with the access permissions . So I checked Baidu and found that it was indeed the case. So I gave Users full control permissions in Tomcat installation folder->Properties->Security , saved it, and ran startup.bat again. It started smoothly.

Then I went back and ran Tomcat again. This time there was no error and Tomcat started successfully! Visit localhost:8080 again, the page is displayed successfully!


Then visit my project page, also successfully accessed! So far this problem has been successfully solved !

Summarize:

Through this problem, I know that the problem may lie in many aspects, and I should think divergently to solve the problem. This time I spent a long time just checking the access address, and then looking for various errors in Tomcat's configuration file. I didn't expect that there would be problems with Tomcat's path and permissions. I should pay more attention to it in the future!

This is the end of this article about how to solve the problem of Tomcat reporting 404 when accessing localhost normally. For more information about Tomcat reporting 404 when accessing localhost normally, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Solution to 404 Problem of Tomcat Installation in Docker
  • Detailed explanation of the solution to Tomcat's 404 error
  • IDEA runs the imported javaweb project tomcat normally, but fails with 404 error
  • Detailed explanation of configuring 404 custom error pages in Tomcat
  • How to solve the 404 problem when starting eclipse's tomcat for access
  • Tomcat starts normally, but all pages you visit report 404 exceptions. Summary and analysis of 404 exceptions

<<:  User needs lead to marketing-oriented design

>>:  Comparison of 5 CSS scrolling ceiling implementation methods (performance upgrade version)

Recommend

Examples of implementing progress bars and order progress bars using CSS

The preparation for the final exams in the past h...

Vue storage contains a solution for Boolean values

Vue stores storage with Boolean values I encounte...

Four ways to modify the default CSS style of element-ui components in Vue

Table of contents Preface 1. Use global unified o...

Tips for writing concise React components

Table of contents Avoid using the spread operator...

HTML simple shopping quantity applet

This article shares a simple HTML shopping quanti...

Detailed explanation of sql_mode mode example in MySQL

This article describes the sql_mode mode in MySQL...

Detailed tutorial for installing mysql5.7.21 under Windows system

MySQL Installer provides an easy-to-use, wizard-b...

MySQL intercepts the sql statement of the string function

1. left(name,4) intercepts the 4 characters on th...

Solution to MySQL 8.0 cannot start 3534

MySQL 8.0 service cannot be started Recently enco...

How to achieve the maximum number of connections in mysql

Table of contents What is the reason for the sudd...

Ubuntu 18.04 disable/enable touchpad via command

In Ubuntu, you often encounter the situation wher...

Example of how to check the capacity of MySQL database table

This article introduces the command statements fo...

Detailed explanation of basic interaction of javascript

Table of contents 1. How to obtain elements Get i...