兒童社會化購物分享社區QQ群:16966020、56878039
大多數朋友都會碰到當在Resin下使用Spring2.0的時候會碰到一些解析Spring XML配置文件的問題,通常最常碰到的是當Spring使用AOP形式來托管事物的時候,如:
?<!– 事物管理配置 –> ?1 ? < aop:config? proxy-target-class =”true”> ?2 ????? <aop:advisor?pointcut =”execution(*? com.wayan..*Action.*(..))”?advice-ref =”txAdvice”/>??? ?3 ? </aop:config > ?4 ? ?5 ? < tx:advice? id =”txAdvice”? transaction-manager =”txManager”> ?6 ????? <tx:attributes > ?7 ??????? < tx:method? name =”get*”? read-only =”true”/> ?8 ??????? <tx:method?name =”find*”? read-only =”true”/> ?9 ??????? <tx:method?name =”*”? /> 10 ????? </ tx:attributes > 11 ? </ tx:advice >
?<!– 事物管理配置 –>
就很容易引起XML文件解析不了,為了解決這類問題可以通過在resin.conf配置文件里加入如下兩行代碼,如:
1 ? < system-property? javax.xml.parsers.DocumentBuilderFactory =”org.apache.xerces.jaxp.DocumentBuilderFactoryImpl”/> 2 ? <system-property?javax.xml.parsers.SAXParserFactory =”org.apache.xerces.jaxp.SAXParserFactoryImpl”/>
強制Resin使用apache的XML解析器來解析,而不是Resin默認的XML解析器來工作,不過這樣的話您需要將xerces.jar和xml-api.jar兩個文件放入您的工程下面才行!作者:曹江華網名:太陽里的雪電話:13590309275QQ:83058327MSN:ardenemily@msn.com郵件:arden.emily@gmail.com首發:http://www.ugole.com蛙眼:http://www.wayan.cn滾吧:http://www.gunba.cn真友:http://www.zhenuu.com
posted on 2007-03-21 16:16 太陽里的雪 閱讀(2174) 評論(2) 編輯 收藏 所屬分類: Java
請問加在哪個位置呀?我換了幾個位置都報錯 回復 更多評論
加到web_app_default中,另外假如你是復制那段配置的話,要將中文“改成英文"才行 回復 更多評論
Powered by: BlogJava Copyright © 太陽里的雪