在配置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>

本文详细介绍了在配置Hibernate时遇到的无法解析绝对文件路径的问题,并提供了有效的解决方案。通过将映射目录从mappingDirectoryLocations更改为mappingLocations,并使用通配符指定映射文件位置,成功解决了路径解析问题。
9388

被折叠的 条评论
为什么被折叠?



