spring BeanCreationException confusion about mapping

后端 未结 3 1516
失恋的感觉
失恋的感觉 2020-12-18 05:16

trying to integrate hibernate and spring ,I ran into this error

SEVERE: Context initialization failed org.springframework.beans.factory.BeanC

3条回答
  •  旧巷少年郎
    2020-12-18 06:07

    This is happening because you have both

    
    

    and

    
    

    The first line will auto-discover and register a SchoolController for you. By explicitly declaring another one, you get a duplicate, and the url-mapping will clash.

    You need to either remove the , or remove the explicit bean definitions for the controller and the DAO. If you do the latter, then you'll need to use autowiring to inject their dependencies.

提交回复
热议问题