spring BeanCreationException confusion about mapping

后端 未结 3 1511
失恋的感觉
失恋的感觉 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 05:54

    I faced similar kind of problem. I have defined the controller class with "@Controller" and also in the Spring-config.xml file as a bean and have injected the dependencies.

    This was causing the problem. @Controller is defining the bean and again, the bean defined in the xml file is redefining the dependencies. I tried autowiring the dependency and removed it as a bean from the xml file. Then it worked.

提交回复
热议问题