当前位置: 代码迷 >> Java Web开发 >> 新手请问:Could not parse configuration: /hibernate.cfg.xml
??详细解决方案

新手请问:Could not parse configuration: /hibernate.cfg.xml

热度:9473???发布时间:2013-02-25 21:14:18.0
新手请教:Could not parse configuration: /hibernate.cfg.xml
才开始学hibernate,对着网上的一个小例子操作。结果出现如下问题:
Java code
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).log4j:WARN Please initialize the log4j system properly.org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1380)    at org.hibernate.cfg.Configuration.configure(Configuration.java:1314)    at org.hibernate.cfg.Configuration.configure(Configuration.java:1300)    at com.elva.hibernate.UserTest.main(UserTest.java:7)Caused by: org.dom4j.DocumentException: Error on line 11 of document  : The string "--" is not permitted within comments. Nested exception: The string "--" is not permitted within comments.    at org.dom4j.io.SAXReader.read(SAXReader.java:482)    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1370)    ... 3 more


一直找不到原因,请高手不吝赐教!谢谢!
配置文件:
User.hbm.xml
XML code
             


hibernate.cfg.xml
[code=XML]
?



?
? com.mysql.jdbc.Driver
? jdbc:mysql://localhost:3306/test
? root
? root
? ?
?
? org.hibernate.dialect.MySQLDialect
? ?
?
? true
? ?
?
? ?


[code]

------解决方案--------------------------------------------------------
??相关解决方案
本站暂不开放注册!
内测阶段只得通过邀请码进行注册!
?
  • 最近登录:Sat Oct 19 13:51:57 CST 2019
  • 最近登录:Sat Oct 19 13:51:57 CST 2019
  • 最近登录:Sat Oct 19 13:51:57 CST 2019
  • 最近登录:Sat Oct 19 13:51:57 CST 2019
  • 最近登录:Sat Oct 19 13:51:57 CST 2019