问题描述
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).log4j:WARN Please initialize the log4j system properly.Warning: Caught exception attempting to use SAX to load a SAX XMLReader java.lang.ClassNotFoundException: org/apache/xerces/parsers/SAXParserWarning: Exception was: java.lang.ClassNotFoundException: org/apache/xerces/parsers/SAXParserWarning: I will print the stack trace then carry on using the default SAX parserat org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)at org.dom4j.io.SAXHelper.createXMLReader(SAXHelper.java:83)at org.dom4j.io.SAXReader.createXMLReader(SAXReader.java:894)at org.dom4j.io.SAXReader.getXMLReader(SAXReader.java:715)at org.dom4j.io.SAXReader.read(SAXReader.java:435)at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1532)at org.hibernate.cfg.Configuration.configure(Configuration.java:1476)at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)at org.eSale.util.ExportDB.main(ExportDB.java:9)Exception in thread "main" org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xmlat org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1542)at org.hibernate.cfg.Configuration.configure(Configuration.java:1476)at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)at org.eSale.util.ExportDB.main(ExportDB.java:9)Caused by: org.dom4j.DocumentException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found Nested exception: SAX2 driver class org.apache.xerces.parsers.SAXParser not foundat org.dom4j.io.SAXReader.read(SAXReader.java:484)at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1532)... 3 more使用SchemExport的时候报这个错是什么意思啊,dom4j.jar包确实加过了,但就是报这个,这是什么情况? 问题补充:lizhi92574 写道
解决方案
引用那些jar包是我拷贝的以前工程的jar,那个项目运行没有问题啊,除了这个原因还有其他原因吗 以前的项目也是那些 jar嘛? 版本一样? 不一样的话就有可能冲突!xercesImpl-2.3.0.jar 先把这个包加进去试试!
解决方案二:
嗯 缺这个包 xercesImpl-2.3.0.jar
解决方案三:
java.lang.ClassNotFoundException: org/apache/xerces/parsers/SAXParser 缺少xerces-2.6.2.jar包
解决方案四:
引用Caused by: org.dom4j.DocumentException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found Nested exception: SAX2 driver class org.apache.xerces.parsers.SAXParser not found 换下 dom4j 的版本!