Exception in thread "main" org.hibernate.InvalidMappingException: Unable to read XML
2014-05-06 17:13
525 查看
2014-5-6 17:12:37 org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
2014-5-6 17:12:37 org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.1.4.Final}
2014-5-6 17:12:37 org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
2014-5-6 17:12:37 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
2014-5-6 17:12:37 org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: /hibernateTest/hibernate.cfg.xml
2014-5-6 17:12:37 org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: HHH000040: Configuration resource: /hibernateTest/hibernate.cfg.xml
2014-5-6 17:12:37 org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappings from resource: hibernateTest/Student2.hbm.xml
Exception in thread "main" org.hibernate.InvalidMappingException: Unable to read XML
at org.hibernate.internal.util.xml.MappingReader.readMappingDocument(MappingReader.java:109)
at org.hibernate.cfg.Configuration.add(Configuration.java:478)
at org.hibernate.cfg.Configuration.add(Configuration.java:474)
at org.hibernate.cfg.Configuration.add(Configuration.java:647)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:730)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2109)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2081)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2061)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2014)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1929)
at hibernateTest.StudentOperate.<init>(StudentOperate.java:12)
at hibernateTest.Program.main(Program.java:15)
Caused by: org.dom4j.DocumentException: http://hibernate.org/dtd/hibernate-mapping-3.0.dtd%20 Nested exception: http://hibernate.org/dtd/hibernate-mapping-3.0.dtd%20
at org.dom4j.io.SAXReader.read(SAXReader.java:484)
at org.hibernate.internal.util.xml.MappingReader.readMappingDocument(MappingReader.java:78)
... 11 more
今天使用hibernate发现这个错误,仔细观察错误日志发现是引用的DTD地址后面多了一个空格
相关文章推荐
- Exception in thread "main" org.hibernate.MappingException: invalid configuration
- Exception in thread &quot;main&quot; org.hibernate.InvalidMappingException: Could not pars
- Exception in thread "main" org.hibernate.MappingNotFoundException: resource: com.xzhl.user.model/Stu
- Exception in thread "main" org.hibernate.MappingException: Unknown entity:
- Exception in thread "main" org.hibernate.MappingException: Unknown entity: XXX
- Exception in thread "main" org.hibernate.MappingException: Unknown entity: com.mao.PersonSet
- 补充org.hibernate.InvalidMappingException: Unable to read XML 的原因
- Exception in thread "main" org.hibernate.HibernateException: No CurrentSessionContext configured!
- Exception in thread "main" org.hibernate.MappingNotFoundException
- Exception in thread "main" org.hibernate.SessionException: Session is closed!
- Exception in thread "main" org.hibernate.AnnotationException: List/array has to be annotated with an
- org.hibernate.InvalidMappingException: Unable to read XML原因及解决办法
- Exception in thread "main" org.hibernate.MappingException
- Hibernate 5.X 版本中Exception in thread "main" org.hibernate.MappingException: Unknown entity: cn.xxx.p
- Exception in thread "main" org.hibernate.HibernateException: save is not valid without active transa
- Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not
- org.hibernate.InvalidMappingException: Unable to read XML 错误分析
- Exception in thread "main" org.hibernate.MappingException: You may only specify a cache for root <cl
- Exception in thread "main" org.hibernate.MappingException: Unknown entity: com.hibernate.domain.User
- Exception in thread "main" org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: