Java SSH工程報錯 Are you running on Java 1.4 or below with Apache Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD suppo

問題描述

ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Parser configuration exception parsing XML from ServletContext resource [/WEB-INF/conf/applicationContext-dataSource.xml]; nested exception is javax.xml.parsers.ParserConfigurationException: Unable to validate using XSD: Your JAXP provider [[email protected]] does not support XML Schema. Are you running on Java 1.4 or below with Apache Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD support.
Caused by:
javax.xml.parsers.ParserConfigurationException: Unable to validate using XSD: Your JAXP provider [[email protected]] does not support XML Schema. Are you running on Java 1.4 or below with Apache Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD support.

 

解決方法:

按錯誤提示中説的“Are you running on Java 1.4 or below with Apache Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD support”,我的jdk版本過低?!我安裝的可是1.5,在dos窗口中java -version一查看,還真是1.4,這才明白過來,是我剛剛裝的Oracle搞得鬼。於是,將環境變量中oracle的jre刪除掉。
重試,還錯?而且還是報一模一樣的錯誤。暈死>_Unable to validate using XSD: Your JAXP provider [[email protected]] does not support XML Schema.”把這個錯誤貼到google上,果然解決方法一大堆,不外乎以下幾種:
1,Xerces版本可能過低,導致解析spring的配置文件時候報錯,靠這句話本身就有問題,spring要解析自己的xml文檔,幹嘛拿一個不能解析的解析工具啊?腦子秀逗了。不過,話雖如此,我還是檔了一對不同版本的Xerces的jar報一個一個試,失敗!
2,Xerces與j2ee裏的xmls.api有衝突,那到底應該刪除掉哪個呢?不管了,試吧,先把Xerces刪除掉,重啓tomcat,失敗!跑到myeclipse裏將其xmls.api包刪除,失敗!真累啊
3,我實在找不到第三個錯誤的可能性了,怎麼辦,算了,豁出去了,一個一個單詞看錯誤信息吧,我看啊看啊,終於:一個下午過去了,繼續看啊看啊Your JAXP provider [[email protected]] does not support XML Schema.    [b]gnu,[/b]好像在那兒見過啊,快點想起來,對了,jfreechart裏好像有這個東東,一看果然 gunjaxp.jar,jfreechart裏有這個東東,刪掉它試試,成功了