zzjvv 2024-03-19 15:53 采纳率: 0%
浏览 17

gateway启动报错,找不到问题出现在哪,构建都没问题,如何解决?

kettleweb版项目启动的时候gateway报错[com.youngdatafan.gateway.GatewayApplication]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/config/annotation/WebMvcConfigurer.class] cannot be opened because it does not exist 您知道什么问题么,找不到哪用了spring-web ,您有遇到过么

  • 写回答

1条回答 默认 最新

  • 码农阿豪@新空间代码工作室 Java领域优质创作者 2024-03-19 15:53
    关注
    让阿豪来帮你解答,本回答参考chatgpt3.5编写提供,如果还有疑问可以评论或留言
    问题描述: 在启动kettleweb版项目时,发现gateway报错,报错信息为:nested exception is java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/config/annotation/WebMvcConfigurer.class] cannot be opened because it does not exist。 问题分析: 这个错误提示是说找不到org.springframework.web.servlet.config.annotation.WebMvcConfigurer类所在的位置,而这个类是属于spring-web模块的。根据这个提示,可以初步判断是项目中缺少了相关的依赖。 解决方案: 1.确认项目中是否添加了spring-web的依赖,如果未添加,需要在maven中添加以下依赖:
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>5.2.0.RELEASE</version>
    </dependency>
    

    2.如果已经添加了依赖,可以尝试清理一下缓存,重新编译打包,然后再次启动项目看看是否还有这个问题。 3.如果以上两种方法无效,可以检查一下项目中使用的spring版本,确保版本是5.2.0.RELEASE或以上版本,如果版本低于这个,可以尝试升级一下spring版本。 代码示例: pom.xml中添加spring-web依赖:

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>5.2.0.RELEASE</version>
    </dependency>
    
    评论

报告相同问题?

问题事件

  • 创建了问题 3月19日

悬赏问题

  • ¥15 如何在vue.config.js中读取到public文件夹下window.APP_CONFIG.API_BASE_URL的值
  • ¥50 浦育平台scratch图形化编程
  • ¥20 求这个的原理图 只要原理图
  • ¥15 vue2项目中,如何配置环境,可以在打完包之后修改请求的服务器地址
  • ¥20 微信的店铺小程序如何修改背景图
  • ¥15 UE5.1局部变量对蓝图不可见
  • ¥15 一共有五道问题关于整数幂的运算还有房间号码 还有网络密码的解答?(语言-python)
  • ¥20 sentry如何捕获上传Android ndk 崩溃
  • ¥15 在做logistic回归模型限制性立方条图时候,不能出完整图的困难
  • ¥15 G0系列单片机HAL库中景园gc9307液晶驱动芯片无法使用硬件SPI+DMA驱动,如何解决?