Don't spring-boot-starter-web and spring-boot-starter-webflux work together?

后端 未结 2 1017
死守一世寂寞
死守一世寂寞 2020-11-30 11:59

When I start to learn the spring-webflux, I have the question about this component.

I builded the simple project, useing the maven to manage the project, and add the

2条回答
  •  青春惊慌失措
    2020-11-30 12:33

    I had a similar issue using spring-boot-starter-webflux and spring-data-geode causing

    DEBUG [http-nio-8082-exec-2] org.sprin.web.servl.resou.ResourceHttpRequestHandler 454 handleRequest: Resource not found
    

    It was resolved by changing the application type

    @SpringBootApplication
    public class Web {
        public static void main(String[] args) {
            SpringApplication app = new SpringApplication(Web.class);
            app.setWebApplicationType(WebApplicationType.REACTIVE);
            SpringApplication.run(Web.class, args);
        }
    }
    

    The whole class looks like this

    After setting the application type, if I don't then call the SpringApplication in a static way, I get this:

提交回复
热议问题