About the solution of Tomcat startup Java.lang.ClassNotFoundException exception

Source: Internet
Author: User

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.

Related Article

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.