问题描述:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sessionFactory' defined in class path resource [applicationcontext.xml]:
Invocation of init method failed; nested exception is org.hibernate.MappingNotFoundException:
resource: org.hibernate.tutorial.annotations.Event not found
Caused by: org.hibernate.MappingNotFoundException: resource: org.hibernate.tutorial.annotations.Event not found
原因:我的文件hibernate.cfg.xml里面写有了
<!-- 3、导入映射文件-->
<mapping resource="org.hibernate.tutorial.annotations.Event"/>
而事实上并没有这个org.hibernate.tutorial.annotations.Event东西,所以只要我们将他注释掉或删除掉即可。