Eclipse starts tomcat normally, http://localhost:8080 cannot be accessed

Original address: https://www.cnblogs.com/zhangboy/p/6877764.html

Symptoms:
tomcat can be started normally in eclipse, but cannot be accessed in the browser when http://localhost:8080/ is accessed, and a 404 error is reported. At the same time, other project pages cannot be accessed.

Close tomcat in eclipse, and double-click startup.bat in the tomcat installation directory to manually start the tomcat server. Visit htt://localhost:8080/ to access the tomcat management page normally.

Cause of symptoms:

Eclipse redirects the tomcat project release directory (webapp in the tomcat directory), so you will find that your project file cannot be found in the webapp directory under the tomcat installation directory.

Solution:

Reconfigure the tomcat server:

On the server page in eclipse, double-click the tomcat service, and you will see the configuration page as shown:
write picture description here

You can see that the selection in the red circle is Use workspace metadata (does not modify Tomcat installion)

If the project is deployed in the tomcat, the options in the red circle will be grayed out and cannot be modified. To modify, you must first remove the deployed services in the tomcat.

As shown in the figure:
write picture description here

Remove the deployed project in the pop-up dialog by right-clicking the tomcat server and selecting Add and Remove. After the removal is confirmed, you will see that the options panel section above is editable.

Select Use tomcat installation (Task control of Tomcat installation), that is, select the installation directory of tomcat as the release directory of the project.

Then, go down four lines and see "Deploy Path"? The default value behind it is "wtpwebapps", change it to "webapps", which is tomcat

The name of the folder where the published project is located.
After modification, close this page and save the configuration. In this way, the project is deployed to the webapp in the tomcat installation directory,
restart the tomcat server, and access http://localhost:8080 can be accessed normally, and the projects deployed by yourself can also be accessed normally.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324690770&siteId=291194637