在用MyEclipse配置一个向数据库插入值的程序遇到的问题!高手进,最好能加我QQ!
1、这个是编译错误:
(如果觉得错误内容太复杂,请着重解释画红线的错误!!)
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
org.hibernate.InvalidMappingException: Could not parse mapping document from resource ch03/hibernate/User.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:575)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1593)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1561)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1540)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1514)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1434)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1420)
at ch03.hibernate.Test.main(Test.java:15)
Caused by: org.hibernate.Invalid
MappingException: Could not parse mapping document from input stream at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:514)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:572)
... 7 more
Caused by:
org.dom4j.DocumentException: Error on line 1 of document : The processing instruction target matching [color=#FF0000]"[xX][mM][lL]" is not allowed. Nested exception: The processing instruction target matching "[xX][mM][lL]" is not allowed.[/color] at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:505)
... 8 more
看了一些回答,主要是说*.hbm.xml里面的申明不正确,即这句话需要改正:
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
但是我觉得这句话没错,一定有其它原因错误,特别是上面报的错误:"[xX][mM][lL]" 是什么意思?
如果想看源代码的请写上你们的QQ,我会一一拜访,虚心请教!或者加我QQ:623041460 可以远程给你看我执行过程!万分感激,同时结交良友!
------解决方案--------------------哎 看你自娱自乐的 什么叫运行Eclipse ..