Element type "property" must be followed by either attribute specifications, ">" or "/>"

Caused by: org.hibernate.InvalidMappingException: Unable to read XML
at org.hibernate.util.xml.MappingReader.readMappingDocument(MappingReader.java:101)
at org.hibernate.cfg.Configuration.add(Configuration.java:513)
at org.hibernate.cfg.Configuration.add(Configuration.java:509)
at org.hibernate.cfg.Configuration.add(Configuration.java:716)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:801)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2344)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2310)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2290)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2243)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2158)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2137)
at com.pear.zcp.Util.HirFactory.<clinit>(HirFactory.java:11)
... 24 more
Caused by: org.dom4j.DocumentException: Error on line 10 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.util.xml.MappingReader.readMappingDocument(MappingReader.java:75)
... 35 more

一开始以为是标签有用错的地方,是否没有闭合。检查没有问题。
又检查映射关系是否正确。检查也没有问题。
最后在一个标签处发现。标签没有自动提示属性等信息。标签里可能含有隐藏的xml无法解析的字符。删掉标签重新写之后。就没有在报错了。错误比较隐秘。

  

时间: 2024-10-07 18:13:09

Element type "property" must be followed by either attribute specifications, ">" or "/>"的相关文章

Element type &quot;LinearLayout&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;的解决办法

看老师的word文档开始学习.复制了一段代码,在layout中新建了一个Android XML file,发现有提示错误. 代码如下: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"               android:layout_width=&

Open quote is expected for attribute &quot;property&quot; associated with an element type &quot;result&quot;.错误

java  Mybatis 框架下的项目 报   Open quote is expected for attribute "property" associated with an element type "result".    这个错 眼快使瞎了,终于找到了 错误写法: <result column="DELETE_STATUS" property=delete_status  jdbcType="VARCHAR"

The content of element type &quot;context&quot; must match &quot;(property*,plugin*,commentGenerator?

最近项目用SSM框架,在利用mybatis generator反向生成数据库对应的model实体时,报如下错误: The content of element type "context" must match "(property*,plugin*,commentGenerator?,jdbcConnection,javaTypeResolver?,javaModelGenerator,sqlMapGenerator?,javaClientGenerator?,table+

hibernate配置文件 The content of element type &quot;class&quot; must match

hibernate映射文件hbm.xml出错,错误信息如下: The content of element type "class" must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natural-id?, (version|timestamp)?,(property|many-to-one|one-to-one|comp

【转】The content of element type &quot;configuration&quot; must match &quot;(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?...

[转]The content of element type "configuration" must match "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?... <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configuration PUBLIC "-//mybat

[Fatal Error] :3:13: Open quote is expected for attribute &quot;{1}&quot; associated with an element type &quot;id&quot;.

用DOM解析XML时出现了如下错误: [Fatal Error] :3:13: Open quote is expected for attribute "{1}" associated with an  element type  "id".org.xml.sax.SAXParseException: Open quote is expected for attribute "{1}" associated with an  element t

Attribute name &quot;aphmodel&quot; associated with an element type &quot;mxg&quot; must be followed by the &#39; = &#39; charac

1.错误描述 org.apache.batik.transcoder.TranscoderException: null Enclosed Exception: Attribute name "aphmodel" associated with an element type "mxg" must be followed by the ' = ' character. at org.apache.batik.transcoder.XMLAbstractTransco

The content of element type &quot;package&quot; must match &quot;(result-types?,interceptors?...

错误:“The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,default-class-ref?,global-results?,global-exception-mappings?,action*)". ” 原因:package里元素必须按照一定的顺序排列: result

jauery改变inout的type属性报错type property can’t be changed

uncaught exception type property can't be changed 使用代码$("#pwd").attr("type","password")时出现上面的错误. 猜测是该版本jQuery不允许修改控件type属性,使用原生js语句可以解决这个问题. [javascript] view plain copy $("#txtpwd").focus(function () { if ($(this).