【Bug解决】Spring配置错误:java.io.FileNotFoundException: class path resource [cxd/entity/User.hbm.xml] canno

来源:互联网 发布:软件编程网站 编辑:程序博客网 时间:2024/06/09 23:00

【错误提示】

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [cxd/entity/User.hbm.xml] cannot be opened because it does not exist


【解决方法】

   <property name="mappingLocations">
    <list>
      <value>classpath:/com/test/bean/user.hbm.xml</value>
    </list>
   </property>


改成

   <property name="mappingLocations">
    <list>
      <value>classpath*:/com/test/bean/*.hbm.xml</value>
    </list>
   </property>


0 0
原创粉丝点击