Exception from running spring-boot-legacy

两盒软妹~` 提交于 2019-12-04 19:15:09

It looks like you're using Spring 4.1.0 and have hit SPR-12151. It's hard to advise on the best course of action as you haven't said which version of Spring Boot you're using.

You have a few options:

  1. Use Spring Boot 1.1.6 and Spring 4.0.7
  2. Declare a custom DispatcherServlet with event publication disabled
  3. Use Spring Boot 1.2.0 snapshots with Spring 4.1.1 snapshots

The second option works as the problem is in the event publication code path. You can declare a custom DispatcherServlet with event publication disabled by adding a bean to your application's configuration:

@Bean(name = DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_BEAN_NAME)
public DispatcherServlet dispatcherServlet() {
    DispatcherServlet dispatcherServlet = new DispatcherServlet();
    dispatcherServlet.setPublishEvents(false);
    return dispatcherServlet;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!