ITeye博客

hibernate中htm.xml注意的一个问题

cheer_nice · 2011-06-08 12:00 · j2se · 企业架构 · Markdown

遇到了这个问题  总是报 

org.hibernate.MappingException: Could not read mappings from resource

这个错误  在hibernate.cfg.xml中 注释掉相应的 那行就ok

仔细检查了那个xxx.hbm.xml  都没有问题 表名  类名都没问题

很郁闷 

 

最后竟然是 因为那个xml文件 在最顶上 有了两个空格 因此出了问题。。。

 

<?xml version="1.0"?> 即这一行 要顶在最上面。。。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。