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

遇到了这个问题  总是报 

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

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

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

很郁闷 

 

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

 

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

猜你喜欢

转载自cheer-nice.iteye.com/blog/1072761