JAXP throw Exception when validate XML with SAX
Posted on 2011-08-10 18:12 itspy 閱讀(465) 評論(0) 編輯 收藏 所屬分類: JAVA技術Exception:Your JAXP provider [org.apache.crimson.jaxp.DocumentBuilderFactoryImpl @1ff7a1e] does not support XML Schema.
只需要在特定目錄添加一個文件:jaxp.properties
內容如下
javax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
javax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
如果是Bea/jrockit可以添加到如下類似目錄
D:\bea\jrockit_160_05\jre\lib
-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl