weixin_42442936
一只敲代码的猿
2011-04-06 16:19

刚开始学hibernate第一个小程序就出了问题,希望指点

  • hibernate

错误信息如下:
Exception in thread "main" 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:510)
at org.hibernate.cfg.Configuration.add(Configuration.java:506)
at org.hibernate.cfg.Configuration.add(Configuration.java:686)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:771)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2314)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2280)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2260)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2213)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2128)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2107)
at StudentTest.main(StudentTest.java:17)
Caused by: org.dom4j.DocumentException: Error on line 2 of document : The processing instruction target matching "[xX][mM][lL]" is not allowed. Nested exception: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.util.xml.MappingReader.readMappingDocument(MappingReader.java:75)
... 11 more
我是和视频学的,查了很久也没看出问题。郁闷呀。如果哪位大哥有学习Java更快更有效的方法,希望不吝赐教。在这里先谢谢了

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

7条回答