Spring Cloud Consul 导致注销 ServletContext
Spring Cloud Consul causes deregistration of ServletContext
在 spring 启动应用程序中提供我有一个 WebMvc
配置扩展了 WebMvcConfigurationSupport.
当我添加依赖项时:
org.springframework.cloud:spring-cloud-starter-consul-discovery:1.2.1.RELEASE
然后我得到:
Factory method 'defaultServletHandlerMapping' threw exception; nested
exception is java.lang.IllegalArgumentException: A ServletContext is
required to configure default servlet handling
有什么提示吗?
谢谢!
从 WebMvcConfigurerAdapter 扩展,修复它。
在 spring 启动应用程序中提供我有一个 WebMvc
配置扩展了 WebMvcConfigurationSupport.
当我添加依赖项时:
org.springframework.cloud:spring-cloud-starter-consul-discovery:1.2.1.RELEASE
然后我得到:
Factory method 'defaultServletHandlerMapping' threw exception; nested exception is java.lang.IllegalArgumentException: A ServletContext is required to configure default servlet handling
有什么提示吗?
谢谢!
从 WebMvcConfigurerAdapter 扩展,修复它。