Maven Eclipse Tomcat Java.lang.ClassNotFoundException:org.springframework.web.context.ContextLoader

Source: Internet
Author: User

Such exceptions are often encountered when using eclipse to consolidate SPRINGMVC: java.lang.classnotfoundexception:o Rg.springframework.web.context.ContextLoaderListener

This means that you cannot find the jar package, and if you are using the MAVEN management jar package, you will find that the jar Bao Mingming is already there, but it is still an error; If the MVN package generates a war pack released to Tomcat, you will find that the project is not a problem.

1. One of the possible reasons for this problem is that the Spring jar package is not loaded, and sometimes it does not occur when the jar package of spring is not copied, but when you copy it, the error does not disappear, indicating that the jar package is not loaded. Remember that spring's jar package must be placed in the project Lib to avoid this error.

2. Duplicate class libraries are used and the versions are inconsistent. Causes the lower version to be used preferentially. For example, today encountered a situation in the Tomcat server using the Axis2.war package, when starting Tomcat, the Axis2.war package will be automatically decompressed, and then the project package has the relevant spring package, so when there is another project to spring, it is possible to go to Axis2 Spring Package, if the version inconsistency causes the problem, the workaround is to leave the project unaffected by the AXIS2 project package.

Add..




Then restart the project.

Maven Eclipse Tomcat Java.lang.ClassNotFoundException:org.springframework.web.context.ContextLoader

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.