Caused by: org.dom4j.DocumentException: Error on line 15 of document : Element type "property" must be followed by either attribute specifications, ">" or "/>". Nested exception: Element type "property" 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:532)
... 40 more
hibernate配置出现问题,而property节点又却是没问题,出现这样的问题,是因为对应的*.hbm.xml文件中字段与数据库字段名不一致或者字符什么的问题,仔细检查一下,我的问题是
<property name="address" column="adrress" type="string"/>
column与数据库中的字段名不一致造成的。
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:532)
... 40 more
hibernate配置出现问题,而property节点又却是没问题,出现这样的问题,是因为对应的*.hbm.xml文件中字段与数据库字段名不一致或者字符什么的问题,仔细检查一下,我的问题是
<property name="address" column="adrress" type="string"/>
column与数据库中的字段名不一致造成的。
本博客详细解释了在使用Hibernate配置时遇到的DocumentException错误,该错误源于*.hbm.xml文件中字段与数据库字段名不一致。通过检查并修正这些问题,可以成功解决配置问题。
1892

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



