出错了搞了一下午,Exception in thread "main" java.lang.ExceptionInInitializerError
十一月 21, 2016 5:52:43 下午 org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.5.Final}
十一月 21, 2016 5:52:43 下午 org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.3.11.Final}
十一月 21, 2016 5:52:43 下午 org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
十一月 21, 2016 5:52:43 下午 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
十一月 21, 2016 5:52:43 下午 org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
十一月 21, 2016 5:52:43 下午 org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
十一月 21, 2016 5:52:43 下午 org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappings from resource: com/imooc/entity/Grade.hbm.xml
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.imooc.entity.Test.add(Test.java:22)
at com.imooc.entity.Test.main(Test.java:11)
Caused by: org.hibernate.InvalidMappingException: Unable to read XML
at org.hibernate.internal.util.xml.MappingReader.legacyReadMappingDocument(MappingReader.java:375)
at org.hibernate.internal.util.xml.MappingReader.readMappingDocument(MappingReader.java:304)
at org.hibernate.cfg.Configuration.add(Configuration.java:518)
at org.hibernate.cfg.Configuration.add(Configuration.java:514)
at org.hibernate.cfg.Configuration.add(Configuration.java:688)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:771)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2257)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2229)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2209)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2162)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2077)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2056)
at com.imooc.util.HibernateUtil.<clinit>(HibernateUtil.java:15)
... 2 more
Caused by: org.dom4j.DocumentException: Error on line 14 of document : 与元素类型 "null" 相关联的 "type" 属性值不能包含 '<' 字符。 Nested exception: 与元素类型 "null" 相关联的 "type" 属性值不能包含 '<' 字符。
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.internal.util.xml.MappingReader.legacyReadMappingDocument(MappingReader.java:325)
... 14 more