• 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

  • 相关阅读:
    NOI-OJ 2.2 ID:6261 汉诺塔
    NOI-OJ 2.2 ID:1696 逆波兰表达式
    NOI-OJ 2.2 ID:8758 2的幂次方表示
    NOI-OJ 2.2 ID:3089 爬楼梯
    NOI-OJ 1.13 ID:34 确定进制
    NOI-OJ 1.7 ID:21 单词替换
    NOI-OJ 1.13 ID:23 区间内的真素数
    【模板】欧拉筛法
    [SHOI2002]滑雪
    【Luogu1217】[USACO1.5]数字三角形(数塔问题) ——动态规划基础
  • 原文地址:https://www.cnblogs.com/alice-cj/p/10422966.html
Copyright © 2020-2023  润新知