After the IntelliJ IDEA project runs successfully, you cannot access the Tomcat homepage or intellijtomcat

Source: Internet
Author: User

After the IntelliJ IDEA project runs successfully, you cannot access the Tomcat homepage or intellijtomcat

Problem

IntelliJ IDEA was used for the first time. However, after running the project to start Tomcat today, the Tomcat Homepage cannot be accessed. The Error 404 is displayed: Enter http: // localhost: 8080 and the Tomcat Homepage cannot be accessed, however, you can access other pages of the Project correctly.

 

Cause

This problem occurs because the output directory of the artifacts of our project is under the directory we specified, rather than under the webapps directory of Apache-tomcat installed in tomcat.

IDEA virtualizes a Tomcat under "project directory \ out \ artifacts", but there is no Tomcat home page project under this directory. At this time, the Tomcat home page project is not deployed on the server, so the Tomcat home page cannot be accessed, and other page information in our project is accessed.

Solution

The solution is to deploy the project of the Tomcat homepage to the Tomcat server. The deployment steps are as follows:

Select "Run --> Edit Configuration..." in the menu bar... --> Deployment, select "+" in the upper right corner, and select "External Source... ", select the ROOT folder under the Apache-tomcat webapps directory, click OK, and deploy the Tomcat homepage project. Select the ROOT file and choose not to fill in the Application Context on the right. The default value is enough.

 

Select "Run --> Edit Configuration... --> Deployment" in the menu bar, select "+" in the upper right corner, select "Artifact...", select the exploded item, and click "OK.

Enter the access URL name in Application Context on the right.

Run the project again and the project runs successfully.

Visit http: // localhost: 8080/again this time.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.