0

我收到此错误:

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
…………

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

谢谢!!

4

1 回答 1

0

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

于 2013-05-02T11:17:22.997 回答