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

MySQL 5.7.17 installation and configuration method graphic tutorial under win7

I would like to share with you the graphic tutori...

Text mode in IE! Introduction to the role of DOCTYPE

After solving the form auto-fill problem discussed...

mysql installer web community 5.7.21.0.msi installation graphic tutorial

This article example shares the specific code for...

Tutorial on building nextcloud personal network disk with Docker

Table of contents 1. Introduction 2. Deployment E...

Is a design that complies with design specifications a good design?

In the past few years of my career, I have writte...

Manually implement js SMS verification code input box

Preface This article records a common SMS verific...

Detailed explanation of HTML basics (Part 2)

1. List The list ul container is loaded with a fo...

Detailed process of installing and deploying onlyoffice in docker

0. System requirements CPU I5-10400F or above Mem...

MySQL solution for creating horizontal histogram

Preface Histogram is a basic statistical informat...

js realizes the image cutting function

This article example shares the specific code of ...

my.cnf parameter configuration to optimize InnoDB engine performance

I have read countless my.cnf configurations on th...

How to connect to MySQL database using Node-Red

To connect Node-red to the database (mysql), you ...