weixin_41063318 2019-05-19 04:23 采纳率: 0%
浏览 3845

maven 的spring mvc项目,can not resolve class 'org.springframework.web.servlet.DispatcherServlet'

因为一次死机, 重启了电脑, 然后项目代码一直跑不了, 于是我觉得去git上拉下来项目。

项目是 maven 的spring mvc + mybatis项目, import进入idea后, 在web.xml文件里,org.springframework.web.servlet.DispatcherServlet 的这个标签一直是红色的找不到, 试过了maven clean , rebuild,都不好使,想问大家怎么解决。 POM.XML包没有报错,就是项目一直跑不起来, 在build的时候就有问题。
图片说明

  • 写回答

4条回答 默认 最新

  • Json-Huang 2019-05-19 09:32
    关注

    检查下settings.xml这个文件仓库地址设置是否可以正常拉包,pom看下包的配置是否有冲突?
    用下面这个试试

    <!-- https://mvnrepository.com/artifact/org.springframework/org.springframework.web.servlet -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.web.servlet</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>
    maven仓库地址:https://mvnrepository.com/artifact/org.springframework/org.springframework.web.servlet/3.1.0.RELEASE
    其他版本也可以试试。
    
    评论

报告相同问题?

悬赏问题

  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用