解决Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.

作者 : admin 本文共261个字,预计阅读时间需要1分钟 发布时间: 2024-06-9 共1人阅读

gateway运行时报错解决Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.插图


原因很明显:SpringMVC和SpringCloudGateway不共存,但是我子项目pom文件根本没有spring-boot-starter-web,是从父项目继承过来的


解决方法①:在application.yml添加spring.main.web-application-type=reactive

解决Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.插图(1)
格式如图

解决方法②:用exclusions排除spring-boot-starter-web依赖

        
            org.springframework.boot
            spring-boot-starter-web
            
                
                    *
                    *
                
            
        

本站无任何商业行为
个人在线分享 » 解决Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.
E-->