hibernate 异常解决方法
来源:互联网 发布:江阴网络诈骗判刑案例 编辑:程序博客网 时间:2024/05/22 10:50
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.hibernate.InvalidMappingException: Could not parse mapping document from resource Student.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:588)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1606)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1574)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1553)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1527)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1447)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1433)
at com.litsoft.hibernate.CreatTable.main(CreatTable.java:9)
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input stream
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:527)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:585)
... 7 more
Caused by: org.dom4j.DocumentException: Error on line 14 of document : Element type "one-to-one" must be followed by either attribute specifications, ">" or "/>". Nested exception: Element type "one-to-one" must be followed by either attribute specifications, ">" or "/>".
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:518)
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.hibernate.InvalidMappingException: Could not parse mapping document from resource Student.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:588)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1606)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1574)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1553)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1527)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1447)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1433)
at com.litsoft.hibernate.CreatTable.main(CreatTable.java:9)
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input stream
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:527)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:585)
... 7 more
Caused by: org.dom4j.DocumentException: Error on line 14 of document : Element type "one-to-one" must be followed by either attribute specifications, ">" or "/>". Nested exception: Element type "one-to-one" must be followed by either attribute specifications, ">" or "/>".
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:518)
... 8 more
这个异常很普遍其实就是hbm文件的书写格式没有写对 也许你的hbm文件一点错误都没有但就是运行报错,最后找到了错误的原因
<one-to-one name="idCard" class="com.litsoft.hibernate.IdCard"
cascade="all "fetch="select" />
在添加<one-to-one><many-to-one>这些标签的时候设置里面的属性时一定要留开空格不然肯定报错
0 0
- Hibernate 异常解决方法
- hibernate 异常解决方法
- org.hibernate.NonUniqueObjectException异常解决方法
- org.hibernate.NonUniqueObjectException异常解决方法
- hibernate 注解使用异常解决方法
- org.hibernate.LazyInitializationException异常解决方法
- 学习hibernate遇到的异常及解决方法
- org.hibernate.NonUniqueObjectException异常解决方法(1)
- org.hibernate.NonUniqueObjectException异常解决方法(2)
- org.hibernate.InstantiationException异常的解决方法
- hibernate报几种异常的及解决方法
- hibernate的一些异常原因及解决方法
- Hibernate的几个常见异常及解决方法
- hibernate报几种异常的及解决方法
- hibernate常见级联操作异常及解决方法
- Hibernate Dialect must be explicitly set异常解决方法
- Hibernate:unexpected end of subtree异常的解决方法
- 学习Hibernate是遇到的异常集解决方法
- linux内核编译与系统调用的添加(适合3.0及以后版本内核)
- c++ 头文件
- shell 二进制 十进制 十六进制 八进制转换
- 没装oracle win764位安装plsql 连接远程数据库服务器
- 写轮眼桌面时钟
- hibernate 异常解决方法
- int a[10]
- Android处理图片OOM的若干方法小结
- 乘法口诀
- 详解Struts2标签库
- Git使用教程(三)--忽略文件
- _itemFailedToPlayToEnd: { kind = 1; new = 2; old = 0; } 引发的搜索
- Tortoise SVN常见图标含义及图标无法正常解决方法!
- centos6.4 安装VMware tools之后还是无法更新软件的问题