hbm文件如何打包在jar中不出现资源文件找不到的问题

来源:互联网 发布:淘宝分销自动分账 编辑:程序博客网 时间:2024/05/29 08:15

在配置hibernate时,如果配置为
<property name="mappingDirectoryLocations">   <list>    <value>classpath:com/test/pojo/</value>   </list></property>


时会出现 cannot be resolved to absolute file path because it does not reside in the 。。。。错误

更改为如下便可以解决问题

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