Error creating bean with name 'defaultServletHandlerMapping

前端 未结 1 673
时光说笑
时光说笑 2020-12-16 08:24

This is a spring (with spring security) + java + maven application on eclipse. I encounter the following error when Submit a signup form. See the rest of my files subsequent

相关标签:
1条回答
  • 2020-12-16 08:59

    I solved the problem with help from a solution to a similar problem on this Platform.

    I excluded configuration filters from being scanned by putting the following annotations in the myappconfig file:

    @EnableWebMvc 
    @Configuration
    @ComponentScan(
      basePackages ={ "com.myapp" }, 
      excludeFilters = { 
        @Filter(type = FilterType.ANNOTATION, value = Configuration.class)
      }
    )
    

    After doing this, the problem was not solved.

    Then I removed @EnableWebMvc and put in myappinit file and issue was solved.

    My guess is that @EnableWebMvc and @ComponentScan(basePackages ={ "com.myapp" }, excludeFilters = { @Filter(type = FilterType.ANNOTATION, value = Configuration.class) }) shouldn't be in the same config file.

    0 讨论(0)
提交回复
热议问题