Skip to content

Commit f94e8bd

Browse files
committed
Do not try to auto-configure Jolokia if Spring MVC is not on classpath
The Jolokia auto-configuration requires ServletWrappingController from Spring MVC to be on the classpath. This commit updates the auto-configuration to make it conditional on the presence of this class. Closes gh-5153
1 parent b4cda62 commit f94e8bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/JolokiaAutoConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import org.springframework.context.annotation.Conditional;
4040
import org.springframework.context.annotation.Configuration;
4141
import org.springframework.core.type.AnnotatedTypeMetadata;
42+
import org.springframework.web.servlet.mvc.ServletWrappingController;
4243

4344
/**
4445
* {@link EnableAutoConfiguration Auto-configuration} for embedding Jolokia, a JMX-HTTP
@@ -61,7 +62,7 @@
6162
*/
6263
@Configuration
6364
@ConditionalOnWebApplication
64-
@ConditionalOnClass({ AgentServlet.class })
65+
@ConditionalOnClass({ AgentServlet.class, ServletWrappingController.class })
6566
@Conditional(JolokiaCondition.class)
6667
@AutoConfigureBefore(ManagementWebSecurityAutoConfiguration.class)
6768
@AutoConfigureAfter(EmbeddedServletContainerAutoConfiguration.class)

0 commit comments

Comments
 (0)