zoukankan      html  css  js  c++  java
  • java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet解决

    spring配置之后启动报错,如下:

    java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
    
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:509)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:490)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1091)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1027)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5038)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5348)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    解决方法:

    是因为没有添加相应的spring-webmvc包,maven添加或者下载加上即可,如下:

    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>4.3.11.RELEASE</version>
    </dependency>
    
    <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.1.0</version>
    </dependency>

    加上引用即可!
    ---------------------
    来源:CSDN
    原文:https://blog.csdn.net/vtopqx/article/details/80499055

  • 相关阅读:
    分布式系统中的Session问题
    HotSpot VM运行时---命令行选项解析
    K大数查询
    [DarkBZOJ3636] 教义问答手册
    小朋友和二叉树
    [COCI2018-2019#2] Sunčanje
    小SY的梦
    [HDU6722 & 2019百度之星初赛四 T4] 唯一指定树
    [HDU6800] Play osu! on Your Tablet
    [NOI2007] 货币兑换
  • 原文地址:https://www.cnblogs.com/alice-cj/p/10422966.html
Copyright © 2011-2022 走看看