admin管理员组文章数量:1794759
解决报错Spring MVC found on classpath, Spring Cloud Gateway at this time. Please remove spring
Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time. Please remove spring-boot-starter-web dependency.
项目中出现这个报错网上差额很多方法都是说 1.排除掉spring-webmvc
<exclusions> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> </exclusion> </exclusions>按网上的修改之后
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-gateway</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> </exclusion> </exclusions> </dependency>我试了都不行,还是报错,报错原因就是因为还没有排除掉 我的项目中引用了一个自己定义的Module,该模块pom.xml里面导入了spring-boot-starter-web ,所以才会导致一直报错,我加的代码又没有效果
<dependency> <groupId>com.ylc.gulimall</groupId> <artifactId>gulimall-common</artifactId> <version>0.0.1-SNAPSHOT</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </exclusion> </exclusions> </dependency>最后在我的代码中加入了exclusions标签,排除该jar包启动成功!
本文标签: 报错MVCclasspathcloudspring
版权声明:本文标题:解决报错Spring MVC found on classpath, Spring Cloud Gateway at this time. Please remove spring 内容由林淑君副主任自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.xiehuijuan.com/baike/1686619114a86990.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论