I'm doing a school skills training program these days.
Configure the template and items, want to see the effect of the template, the results in the browser address bar enter localhost:8080/project name
Error 404 appears, check web.xml has set welcome section. The steering console found the cause of the anomaly was java.lang.ClassNotFoundException.
A class that cannot be found does not exist in the project at all. At this point, the project that is running in Tomcat has only this new project.
Troubled for a long time. Think of a cache presence in the Tomcat folder for items that used to be wrong. So go to Tomcat under the WebApps folder and delete irrelevant items. But do not delete your own folders (docs, examples, Host-manager, manager, Root need to keep) and then go to the Work\catalina\localhost folder to delete irrelevant items. Then restart the server. Without mistakes, the problem is solved perfectly.
And then Baidu a few other possible cases, there are the following:
1. The jar package that needs to be relied on is not imported. Workaround: Add the jar package containing the class to the classpath in Tomcat's JVM settings ECLIPSE->WINDOW->PREFERENCE->TOMCAT->JVM Settings->classpath-> add the missing class's jar bundle->ok (Source: http://www.cnblogs.com/ericsun/archive/2012/02/14/2350626.html)
2. Because multiple versions of the JDK are installed on the computer, the solution is to right-click the JDK in the engineering directory to select Build path---->config build path or click Project-----on the Eclipse menu bar > Propertys in the inside again select Java Build Path-----> Libraries---->add Libraries----->jre System Library (Source: http://zhidao.b AIDU.COM/LINK?URL=VE2KH7IEEIBGQRXSBXITUT3FSGQ34YW-BL-PVFPHGFPZHYIXXBA1VV-PGDZ42NB-3JVY1ZKL3YAMUC1-TI9NXA)
3. The reason for this article is that the wrong item is still in Tomcat.
Niche beginners soon, if there is a mistake, but also hope that the predecessors of the guidance, thank you.