Eclipse startup tomcat cannot access the solution

  • 2020-04-01 02:22:26
  • OfStack

Symptoms:

Tomcat starts properly in eclipse, but cannot be accessed in a browser by accessing http://localhost:8080/, and a 404 error is reported. Other project pages are also inaccessible.

Close tomcat in eclipse and manually start the tomcat server by double-clicking startup.bat in the tomcat installation directory. Access HTT ://localhost:8080/ normal access to the tomcat management page.

Causes of symptoms:

            Eclipse has redirected the tomcat project distribution directory (webapp in the tomcat directory), so you will find that your project files cannot be found in the webapp directory under the tomcat installation directory.

Solutions:

Reconfigure tomcat Server:

On the server page in eclipse, double-click the tomcat service to see the configuration page as shown in the figure:

< img border = 0 SRC = "/ / files.jb51.net/file_images/article/201310/20131028154851707.jpg" >

You can see that the red circle selects workspace metadata(does not modify Tomcat installion)

If the project is deployed in tomcat, the options in the red circle will be blurred and cannot be changed. To do so, all deployed services in tomcat must be removed.

As shown in figure:

< img border = 0 SRC = "/ / files.jb51.net/file_images/article/201310/20131028154956987.jpg" >

Remove the deployed project in the pop-up dialog box by right-clicking on the tomcat server and selecting Add and Remove. After removing the ok, you will see that the options panel above is partially editable.

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

And then, the next four lines, you see "Deploy Path"? The default value after it is "wtpwebapps", change it to "webapps", namely tomcat

Publishes the folder name of the project.
Close the page after modification and save the configuration. This will deploy the project to webapp in the tomcat installation directory
Restart the tomcat server, access http://localhost:8080, and your deployed project will be accessible.


Related articles: