在web.xml中的最后</web-app>前加上下面這些
<system-property javax.xml.transform.TransformerFactory="org.apache.xalan.processor.TransformerFactoryImpl"/>
<system-property javax.xml.parsers.DocumentBuilderFactory="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
<system-property javax.xml.parsers.SAXParserFactory="org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
<system-property org.xml.sax.driver="org.apache.xerces.parsers.SAXParser"/>
沒事看了下hibernate,還有struts,用了用MyEclipse 4.0.2,就試著用MyEclipse建立一個web aplication,再add hibernate capabilities和add struts capabilities,然后運行resin 3.0.14,就看到錯誤了,開始是個log4j的問題,這個是hibernate的問題,把hibernate(src)里etc中的log4j.properties文件復(fù)制到和hibernate.cfg.xml同一個目錄,就沒有這個問題了,剩下的問題如下:
21:13:32,500 ERROR Digester:686 - Digester.getParser:
org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/validation/dynamic
at com.caucho.xml.parsers.XmlSAXParserFactory.setFeature(XmlSAXParserFactory.java:94)
at org.apache.commons.digester.parser.XercesParser.configureXerces(XercesParser.java:185)
at org.apache.commons.digester.parser.XercesParser.newSAXParser(XercesParser.java:138)
上網(wǎng)查了一下,是找不到xercesImpl.jar的原因,解決方法如下:
方法一:在%JAVA_HOME%/jre/lib文件夾下面,建立一個jaxp.properties文件,內(nèi)容只有一句
javax.xml.parsers.SAXParserFactory: org.apache.xerces.jaxp.SAXParserFactoryImpl
問題解決。
方法二:找到xercesImpl.jar,復(fù)制到%JAVA_HOME%/jre/lib/endorsed下面(沒有這個目錄就創(chuàng)建這個目錄),問題解決。
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請
點擊舉報。