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
pull/5489/head
Andy Wilkinson 9 years ago
parent b4cda625c4
commit f94e8bd287

@ -39,6 +39,7 @@ import org.springframework.context.annotation.ConditionContext;
import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.core.type.AnnotatedTypeMetadata; import org.springframework.core.type.AnnotatedTypeMetadata;
import org.springframework.web.servlet.mvc.ServletWrappingController;
/** /**
* {@link EnableAutoConfiguration Auto-configuration} for embedding Jolokia, a JMX-HTTP * {@link EnableAutoConfiguration Auto-configuration} for embedding Jolokia, a JMX-HTTP
@ -61,7 +62,7 @@ import org.springframework.core.type.AnnotatedTypeMetadata;
*/ */
@Configuration @Configuration
@ConditionalOnWebApplication @ConditionalOnWebApplication
@ConditionalOnClass({ AgentServlet.class }) @ConditionalOnClass({ AgentServlet.class, ServletWrappingController.class })
@Conditional(JolokiaCondition.class) @Conditional(JolokiaCondition.class)
@AutoConfigureBefore(ManagementWebSecurityAutoConfiguration.class) @AutoConfigureBefore(ManagementWebSecurityAutoConfiguration.class)
@AutoConfigureAfter(EmbeddedServletContainerAutoConfiguration.class) @AutoConfigureAfter(EmbeddedServletContainerAutoConfiguration.class)

Loading…
Cancel
Save