第一次用Spring整合Hibernate,在整合配置测试的时候一直出现如下问题:
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.InvalidMappingException: Could not read mapping documents from jar: Account.hbm.xml
后面上网查了资料发现Spring整合Hibernate配置有四种方式:
1.mappingResource
2.mappingLocations
3.mappingDirectoryLocations
4.mappingJarLocations
详细解释:https://www.cnblogs.com/bmbi/p/5299953.html