• 在用eclipse创建完SpringMVC案例后,配置文件都没有错,启动Tomcat就报错!!!


    java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1360)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1182)
        at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:546)
        at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:527)
        at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1044)
        at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:763)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:134)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:528)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:810)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)

    解决方案:

    在项目上右键properties(最后一项),打开如下界面

    Add -> Java Build Path Entries -> Next -> Maven Dependencies -> Finish -> Ok,配置完后如下图:

  • 相关阅读:
    非原创-MongoDB PHP 扩展
    原创-docker命令
    原创-k8s nginx内核参数优化
    原创-阿里云K8S-PVCyaml文件挂载云盘
    原创-k8s反亲和性
    使用Virtualenv隔离Python、Ansible不同发行版
    基于Scrapy分布式爬虫的开发与设计
    CentOS7.3中将Python2.7.5 升级到Python3.5.1
    如何让django的model名和应用名显示为中文
    Django添加ckeditor富文本编辑器
  • 原文地址:https://www.cnblogs.com/wangrui-liyin/p/11973264.html
Copyright © 2020-2023  润新知