java.lang.ClassNotFoundException: org/apache/xerces/parsers/SAXParser难题求解

jason1985 2009-04-02 04:58:47
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
Warning: Exception was: java.lang.ClassNotFoundException: org/apache/xerces/parsers/SAXParser
Warning: I will print the stack trace then carry on using the default SAX parser
java.lang.ClassNotFoundException: org/apache/xerces/parsers/SAXParser
at 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:74)
at org.dom4j.io.SAXReader.createXMLReader(SAXReader.java:647)
at org.dom4j.io.SAXReader.getXMLReader(SAXReader.java:530)
at org.dom4j.io.SAXReader.read(SAXReader.java:309)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1484)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1428)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1414)
at cf.common.util.HibernateUtil.<clinit>(HibernateUtil.java:28)
at cf.dao.test.TestIUserDao.main(TestIUserDao.java:22)
Initial SessionFactory creation failed.org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
Exception in thread "main" java.lang.ExceptionInInitializerError
at cf.common.util.HibernateUtil.<clinit>(HibernateUtil.java:33)
at cf.dao.test.TestIUserDao.main(TestIUserDao.java:22)
Caused by: org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1494)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1428)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1414)
at cf.common.util.HibernateUtil.<clinit>(HibernateUtil.java:28)
... 1 more
Caused by: org.dom4j.DocumentException: Could not initialize a SAX Parser. Please add a SAX parser to your classpath along with preferably jaxp.jar Nested exception: Could not initialize a SAX Parser. Please add a SAX parser to your classpath along with preferably jaxp.jar
at org.dom4j.io.SAXReader.read(SAXReader.java:358)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1484)
... 4 more
在开发hibernate+struts+jsp开发一个项目中,测试DAO层是否连通数据库的时候出现该问题,不知道是不是导入包的问题,请哪位高手指点!
...全文
2426 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
mash5_paul 2012-08-14
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 的回复:]

LZ到网上下xerces.jar包导入试下
[/Quote]

感谢感谢
chayahua767 2011-05-05
  • 打赏
  • 举报
回复
太没人品了,这样的人以后提问都不帮他回答
A_cool 2010-08-27
  • 打赏
  • 举报
回复
太业余了吧,解决了也不说怎么解决的。
jason1985 2009-05-05
  • 打赏
  • 举报
回复
不好意思,问题已经自己解决了!谢谢各位!
PostX 2009-05-05
  • 打赏
  • 举报
回复
这种问题也好意思提出来。。。
愤怒的月光 2009-04-06
  • 打赏
  • 举报
回复
LZ到网上下xerces.jar包导入试下
yangfeitarena 2009-04-04
  • 打赏
  • 举报
回复
跟数据库连接没关系。你项目中可能用到了dom4j,还应该导入dom4j的包。

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧