Spring MVC Error: Java.lang.ClassNotFoundException:org.springframework.web.servlet.DispatcherServlet

Source: Internet
Author: User

Critical: Allocate exception for servlet SPRINGMVC
Java.lang.ClassNotFoundException:org.springframework.web.servlet.DispatcherServlet
At Org.apache.catalina.loader.WebappClassLoaderBase.loadClass (webappclassloaderbase.java:1892)
At Org.apache.catalina.loader.WebappClassLoaderBase.loadClass (webappclassloaderbase.java:1735)
At Org.apache.catalina.core.DefaultInstanceManager.loadClass (defaultinstancemanager.java:504)
At Org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged (defaultinstancemanager.java:486)
At Org.apache.catalina.core.DefaultInstanceManager.newInstance (defaultinstancemanager.java:113)
At Org.apache.catalina.core.StandardWrapper.loadServlet (standardwrapper.java:1133)
At Org.apache.catalina.core.StandardWrapper.allocate (standardwrapper.java:853)
At Org.apache.catalina.core.StandardWrapperValve.invoke (standardwrappervalve.java:134)
At Org.apache.catalina.core.StandardContextValve.invoke (standardcontextvalve.java:122)
At Org.apache.catalina.authenticator.AuthenticatorBase.invoke (authenticatorbase.java:505)
At Org.apache.catalina.core.StandardHostValve.invoke (standardhostvalve.java:169)
At Org.apache.catalina.valves.ErrorReportValve.invoke (errorreportvalve.java:103)
At Org.apache.catalina.valves.AccessLogValve.invoke (accesslogvalve.java:958)
At Org.apache.catalina.core.StandardEngineValve.invoke (standardenginevalve.java:116)
At Org.apache.catalina.connector.CoyoteAdapter.service (coyoteadapter.java:452)
At Org.apache.coyote.http11.AbstractHttp11Processor.process (abstracthttp11processor.java:1087)
At Org.apache.coyote.abstractprotocol$abstractconnectionhandler.process (abstractprotocol.java:637)
At Org.apache.tomcat.util.net.jioendpoint$socketprocessor.run (jioendpoint.java:316)
At Java.util.concurrent.ThreadPoolExecutor.runWorker (threadpoolexecutor.java:1142)
At Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:617)

First build Springmvc, try the first interface to report this mistake, Little rookie is a little panic, has been according to the video, do not know which step is wrong.

Look at the exception is a lack of a class, Org.springframework.web.servlet.DispatcherServlet, the role of this class is big drop.

Dispatcherservlet is mainly used for responsibility scheduling, itself mainly for the control process, the main responsibilities are as follows:

1, File upload parsing, if the request type is multipart will be through the Multipartresolver file upload parsing;

2, through the handlermapping, map the request to the processor (return a handlerexecutionchain, which includes a processor, multiple handlerinterceptor interceptors);

3. Support multiple types of processors (processors in handlerexecutionchain) through Handleradapter;

4, through the Viewresolver analytic logical view name to the concrete view realization;

5, localization analysis;

6, rendering the specific views, etc.;

7, if the execution process encountered an exception will be given to Handlerexceptionresolver to resolve.

From the above we can see that Dispatcherservlet is mainly responsible for the control of the process

Review the previous knowledge to know that this class is configured in Web. XML,

crtl+ left click, do not open, and then re-import its jar package, OK, perfect solution

Tip: crtl+ Left-click, you can determine in the configuration file that the corresponding class has been successfully introduced.

Spring MVC Error: Java.lang.ClassNotFoundException:org.springframework.web.servlet.DispatcherServlet

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.