【问题标题】:Spring Cloud Consul causes deregistration of ServletContextSpring Cloud Consul 导致 ServletContext 注销
【发布时间】:2018-02-14 05:40:04
【问题描述】:

在 Spring Boot 应用程序中,我有一个 WebMvc 配置,它扩展了 WebMvcConfigurationSupport

当我添加一个依赖项时:

org.springframework.cloud:spring-cloud-starter-consul-discovery:1.2.1.RELEASE

然后我得到:

工厂方法'defaultServletHandlerMapping'抛出异常;嵌套的 异常是 java.lang.IllegalArgumentException:一个 ServletContext 是 需要配置默认 servlet 处理

有什么提示吗?

谢谢!

【问题讨论】:

    标签: spring-mvc spring-boot spring-cloud-consul


    【解决方案1】:

    改为从 WebMvcConfigurerAdapter 扩展,修复它。

    【讨论】:

      猜你喜欢
      • 2020-05-18
      • 2017-01-20
      • 2016-02-18
      • 2015-11-04
      • 2016-11-11
      • 1970-01-01
      • 2019-06-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多