SPRINGMVC Maven Project Java.lang.ClassNotFoundException:org.springframework.web.servlet.DispatcherServle

Source: Internet
Author: User

Today, when building the SPRINGMVC development Framework, a problem was encountered, although the jar packages that the project depended on were configured in the Maven Pom.xml file, but the startup project was already error-free as follows:

Info: Starting Servlet engine:apache tomcat/7.0. AboutNovember -, . 3: +: -pm Org.apache.catalina.util.SessionIdGenerator createsecurerandom Info: Creation of SecureRandom instance forSession ID Generationusing[Sha1prng] took [187] milliseconds. November -, . 3: +: -pm Org.apache.catalina.core.ApplicationContext Log Info: marking servlet springmvc asunavailable November -, . 3: +: -afternoon org.apache.catalina.core.StandardContext loadonstartup severity: Servlet/CRM threw load () Exceptionjava.lang.ClassNotFoundException:org.springframework.web.servlet.DispatcherServlet At Org.apache.catalina.loader.WebappClassLoader.loadClass (Webappclassloader.java:1720) at Org.apache.catalina.loader.WebappClassLoader.loadClass (Webappclassloader.java:1571) at Org.apache.catalina.core.DefaultInstanceManager.loadClass (Defaultinstancemanager.java:506) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged (Defaultinstancemanager.java: 488) at Org.apache.catalina.core.DefaultInstanceManager.newInstance (Defaultinstancemanager.java: the) at Org.apache.catalina.core.StandardWrapper.loadServlet (Standardwrapper.java:1148) at Org.apache.catalina.core.StandardWrapper.load (Standardwrapper.java:1087) at Org.apache.catalina.core.StandardContext.loadOnStartup (Standardcontext.java:5231) at Org.apache.catalina.core.StandardContext.startInternal (Standardcontext.java:5518) at Org.apache.catalina.util.LifecycleBase.start (Lifecyclebase.java: Max) at Org.apache.catalina.core.containerbase$startchild.call (Containerbase.java:1575) at Org.apache.catalina.core.containerbase$startchild.call (Containerbase.java:1565) at Java.util.concurrent.FutureTask.run (Futuretask.java:266) at Java.util.concurrent.ThreadPoolExecutor.runWorker (Threadpoolexecutor.java:1142) at Java.util.concurrent.threadpoolexecutor$worker.run (Threadpoolexecutor.java:617) at Java.lang.Thread.run (Thread.java:748) November -, . 3: +: -pm Org.apache.coyote.AbstractProtocol Start Info: Starting Protocolhandler ["http-bio-8080"] November -, . 3: +: -pm Org.apache.coyote.AbstractProtocol Start Info: Starting Protocolhandler ["ajp-bio-8009"] November -, . 3: +: -pm Org.apache.catalina.startup.Catalina Start info: Server startupinch 630Ms

The problem was found to be the package required by spring, and Maven was downloaded to the local library, but it was not referenced when the project started.

The solution is as follows:
* * Project name right-click Properties-Deployment Assembly,
ADD, Java Build Path Entries, next select Maven dependencies**

My project will work as soon as this is done, but it is found that there may be a small problem at this point, although the spring jar is referenced in the project, but the class library cannot be referenced in the code, the problem is resolved as follows:
**1. Project name right-click Maven---Disable maven Nature;
2. Project name, right-click, Configure, Convert to Maven project;
3. Finally, it is necessary to check again if there is a recurrence of the two problems described above, if any, repeat the steps; * *

SPRINGMVC Maven Project Java.lang.ClassNotFoundException:org.springframework.web.servlet.DispatcherServle

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.