Tomcat starts normally but accesses 404

Source: Internet
Author: User

Recently encountered some wonderful problems, and made long time to dispose of. Just record it today for a rainy day.

Problem Description:

After the completion of the integration of the Spring MVC project, Tomcat was started normally, and Tomcat was found to be successful, but when it visited localhost, it found 404.

Problem Analysis:

The first thought that the resources they requested do not exist, and later carefully check the resources of their own real existence, this is a bit strange, the resources of their request clearly exist, but why still appear 404?

Self-pondering for a long time, and finally found the reason, I have modified the path of the package, but did not re-modify the path of scanning annotations, it will be reported 404 error ~ ~ Ah, the next time you have to pay attention, delayed their own small

Half a day's time.

In addition, there is a possibility that the row will be accessed 404 (except the request resource path is not correct), that Tomcat does not see the error in the console during the boot process, but after careful review of Tomcat's boot log, you will

Found that Tomcat did throw an exception when it started. This situation also need to pay attention to ~ ~

Workaround:

Modify the scan path of the package to be correct ~

    <context:component-scan base-package = "com.jd.jr.rsm.ent.*"/>

Tomcat starts normally but accesses 404

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.