【问题标题】:Error creating bean with name 'transactionManager'创建名为“transactionManager”的 bean 时出错
【发布时间】:2013-05-02 09:56:27
【问题描述】:

我收到此错误:

ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in file [C:\Users\Tecnico1\Documents\workspace-sts-3.2.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\marshall\WEB-INF\classes\META-INF\spring\applicationContext.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in file [C:\Users\Tecnico1\Documents\workspace-sts-3.2.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\marshall\WEB-INF\classes\META-INF\spring\applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: @OneToOne or @ManyToOne on 
………
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in file [C:\Users\Tecnico1\Documents\workspace-sts-3.2.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\marshall\WEB-INF\classes\META-INF\spring\applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: @OneToOne or @ManyToOne on
….….
Caused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on com.springsource.marshall.domain.DocumentoReservaHabitacion.reservaHabitacionId references an unknown entity: com.springsource.marshall.domain.ReservaHabitacion
…………

我是一个初学者,我没有发现错误......也许我有重复的罐子......在那种情况下......我必须删除什么罐子??

谢谢!!

【问题讨论】:

    标签: spring hibernate maven transactionmanager


    【解决方案1】:

    您的实体 com.springsource.marshall.domain.ReservaHabitacion 未映射到 hibernate.cfg.xml 文件中,或者您在该类上缺少 @Entity 注释。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-28
      • 2020-10-03
      • 2019-08-28
      • 2015-03-18
      • 2021-03-17
      • 2021-06-18
      • 2019-07-21
      • 2016-04-04
      相关资源
      最近更新 更多