Hibernate 4出现的Could not parse mapping document from resource,Duplicate class/entity mapping
来源:互联网 发布:端口映射软件 编辑:程序博客网 时间:2024/06/05 04:45
初学Hibernate,用的又是最新版本,在运行类似HelloWord程序时出现了Could not parse mapping document from resource...在网上寻找原因,都说出现这种原因一般是配置文件出错,然后我就仔仔细细的查看了配置文件,就是没找出错误,接着我查看了引起异常的地方Duplicate class/entity mapping ,然后我有查看类中的方法,发现我在创建SessionFacotry用错了方法,由于当初创建SessionFacotry时对Hibernate 4 新的创建方法不是很懂,直接复制了网上的方法,导致出现错误,错误代码如下:
Configuration cfg = new Configuration().configure();
StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder().applySettings(cfg.getProperties());
StandardServiceRegistryImpl registryImpl = (StandardServiceRegistryImpl) builder.build();
SessionFactory sf = cfg.configure().buildSessionFactory(registryImpl);
解决方案,将上述代码改为SessionFactory sf = cfg.buildSessionFactory(registryImpl);
0 0
- Hibernate 4出现的Could not parse mapping document from resource,Duplicate class/entity mapping
- hibernate: Duplicate class/entity; Could not parse mapping document from resource
- org.hibernate.InvalidMappingException: Could not parse mapping document from resource
- org.hibernate.InvalidMappingException: Could not parse mapping document from resource
- Hibernate提示 Could not parse mapping document from resource...
- org.hibernate.InvalidMappingException: Could not parse mapping document from resource
- org.hibernate.InvalidMappingException: Could not parse mapping document from resource
- org.hibernate.InvalidMappingException: Could not parse mapping document from resource
- Could not parse mapping document from resource Duplicate collection role mapping
- Hibernate下出现Could not parse mapping document from resource xx.hbm.xml
- hibernate 出现Could not parse mapping document from resource 报错
- Hibernate:Could not parse mapping document from invalid mapping Could not parse mapping document
- org.hibernate.InvalidMappingException: Could not parse mapping document from resource 处理办法
- org.hibernate.InvalidMappingException: Could not parse mapping document from resource 处理办法
- 学习hibernate遇到问题之Could not parse mapping document from resource
- org.hibernate.InvalidMappingException: Could not parse mapping document from resource cn/ljt/hiberna
- org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/**/**.hbm
- org.hibernate.InvalidMappingException: Could not parse mapping document from resource 处理办法
- 江西丰城双线机柜出租,量大从优!欢迎咨询qq712346922
- 2014.5.12 JFinal HSSFWorkbook导入Excel 并解析内容
- jxl导出excel
- 计算三角网格的顶点法向量
- leetcode Combinations
- Hibernate 4出现的Could not parse mapping document from resource,Duplicate class/entity mapping
- 2. 函数的声明
- 设计学院5月免费公开课-ps抠图/网站配色技巧/UI设计/字体设计
- $(document).ready(function()
- Android实践--如何提高Android模拟器的运行速度
- 建一个本地git服务器(git详细操作)
- Spark 0.9.1和Shark 0.9.1分布式安装指南
- ios如何获取序列号和IMEI号 公有api
- WPF数据表格控件Xceed DataGrid for WPF详细介绍