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