org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sessionFactory'

后端 未结 1 1045
名媛妹妹
名媛妹妹 2020-12-31 09:40

I am using spring and hibernate for configuration with mysql db.

My we.xml file has following code :

         


        
相关标签:
1条回答
  • 2020-12-31 10:20

    Spring is telling you exactly what the problem is, you just have to read the log and nested error message:

    Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sessionFactory': FactoryBean which is currently in creation returned null from getObject

    A bit of Google searching suggests that this error message is usually the result of a circular dependency, and also led to a mailing list post that recommends removing default-autowire="detect" from your <beans> element.

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