Solve the problem of idea project startup report 404

 

    I am learning IDEA recently. Since I have been using Eclipse before, I have encountered a lot of pitfalls when I first contacted IDEA. The most troublesome one is probably how to start IDEA smoothly. I will not go into details about this aspect. , There are already a lot of tutorials on the Internet. I will also give you an IDEA learning attachment later. Those who are interested can take a look. Today I mainly talk about how to solve the problem of 404 when the IDEA project starts up. I believe many Friends like me who have come into contact with IDEA for the first time have all fallen into this pit. Today, I will take you to understand this pit and how to solve it.

  First, let's take a look at the 404 page:

  

 

  

 

 

  From this picture, we can actually see a little clue, pay attention to the last sentence: description The requested resource is not available.

  This sentence translates roughly to mean, Description: The requested resource is not available.

  Since it is a problem of requesting resources, and IDEA starts the project by first packaging the project into a war package, then creating a Tomcat, and loading the war, then we can guess that the problem that the requested resource is unavailable must be It is a problem that occurs in the process of packaging the war package, or when Tomcat loads the war package. In addition to these two possibilities, there is another possibility, which I have experienced myself, that is, your project is an SVN project, and your SVN path is no longer available.

  Know the reason, then the next step is easy, we will solve it one by one.

  Step 1: How to package the project into a war package:

    1. First, right-click the project and click open module settings

write picture description here.

2. Configure the project, mainly the installation path of the local jdk, and the path of the project compilation output

3. Configure modules, where paths are located to web-inf/classes; dependencies are added to jdk and project web-inf/lib

     

    4. Configure libraries, click the + sign, select java, and then select the web-inf/lib of your project

    

    5. Configure facets. This step is very important. Configure web resource directories. If the path is mismatched, 404 will be reported. Be sure to locate the project root directory, which is where the entire project source code is located below.

    

    6. Configure artifacts, select the second one in this step, and select your project.

    

    Note: This is a very important step. After adding, be sure to select your project, and then click Put into Output Root with the left mouse button.

    

    At this point, the packaging of the project has been completed, and then the project is added to Tomcat.

    The second step, add the project to Tomcat:

    1. In the upper right corner of the IDEA page, click here to open the Tomcat add page

    

    2. Add Tomcat on the newly opened page

    

     

    3. Configure Tomcat's name, default browser, access address, JRE, port, etc. on the newly added Tomcat page

    

    On this page, we can see that su9oyouTomcat is still very popular because the project war package has not been added, and then click Deployment to add the project war package

    

    4. Add the packaged war package to Tomcat

    

    After adding, you can configure the suffix name of the path. I just use / to save trouble, and then click Apply and OK.

    

    5. Then start Tomcat and you can access the project directly by accessing localhost.

    

    

  

    The third step is to solve the reason for SVN to access 404

    If you have gone through the above steps, your Tomcat does not report an error, but your access is still 404, and if it is an SVN project, you can try to see if it is a problem with your SVN configuration.

    1. First confirm whether SVN can be connected:

    

    

    If your SVN exploded this error, you can go to see if your configuration is wrong

    

    2. Reconfigure SVN, click File, Settings, find Subversion, remove the check in it, then Apply, OK is OK.

    

    

    

    3. You can re-test whether SVN can be connected:

    

    4. Then restart Tomcat, it's OK

    

 

    Conclusion: Since looking back is just beginning to learn to use IDEA, so I just share the pits I encountered when looking back. If there are any other reasons that are not covered in this article, you are welcome to let us know in the comment area below. Let's learn together and make progress together!

       Finally, if you have a friend who thinks that the review is well written, you can give a like or add a follow, and the review will always be shared with you and grow together~~~

  

Guess you like

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