您的位置:首页 > 编程语言 > Java开发

java学习bug总结

2014-01-12 16:39 330 查看
错误1:nested exception is javax.xml.parsers.FactoryConfigurationError:

Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found

Caused by: javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found

at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
解 决方法: 

设置两个属性 (javax.xml.parsers.DocumentBuilderFactory,javax.xml.parsers.SAXParserFactory) 值如下:

System.setProperty("javax.xml.parsers.DocumentBuilderFactory",

       "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");

System.setProperty("javax.xml.parsers.SAXParserFactory",

       "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl");

原因:是使用MyEclipse创建项目时引用了 J2EE 1.4 Library Container库(JAVA构建路径-->库)

错误二:java.lang.reflect.InvocationTargetException

原因:jdk版本问题,配置出错,还有可能是缺少jar文件的原因。我出现过那次问题是因为配置出错了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  java bug