From ca329d3d035bb452ce3090e47dfae223e3f83ff7 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Sat, 6 Oct 2018 12:59:25 +0100 Subject: [PATCH] Update Jersey indicator class to one that requires the Servlet API Previously, if WebFlux and Jersey were on the classpath, but there was no Servlet API (and no embedded container) on the classpath, the web application type would be prevented from being reactive. The absence of the Servlet API would then prevent the web application type from being servlet so it would be none. By contrast, if Spring MVC was on the classpath in place of Jersey the absence of the Servlet API would allow the web application type to be reactive. This happened because the Spring MVC indicator class is DispatcherServlet which requires the Servlet API. This commit updates the Jersey indicator class to be ServletContainer. This class is both an HttpServlet and a Filter so it too requires the Servlet API and, therefore, further aligns the deduction behaviour for Jersey and Spring MVC. Closes gh-14701 --- .../main/java/org/springframework/boot/WebApplicationType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/WebApplicationType.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/WebApplicationType.java index f95233d5f7..b965441291 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/WebApplicationType.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/WebApplicationType.java @@ -54,7 +54,7 @@ public enum WebApplicationType { private static final String WEBFLUX_INDICATOR_CLASS = "org." + "springframework.web.reactive.DispatcherHandler"; - private static final String JERSEY_INDICATOR_CLASS = "org.glassfish.jersey.server.ResourceConfig"; + private static final String JERSEY_INDICATOR_CLASS = "org.glassfish.jersey.servlet.ServletContainer"; private static final String SERVLET_APPLICATION_CONTEXT_CLASS = "org.springframework.web.context.WebApplicationContext";