Spring 官方已經(jīng)提到這個(gè)錯(cuò)誤了
http://www.springframework.org/docs/reference/xsd-config.html#xsd-config-integration-resin
A.3.3.1. XML parsing errors in the Resin v.3 application server
If you are using the XSD-style for Spring 2.0 XML configuration and deploying to v.3 of Caucho's Resin application server, you will need to set some configuration options prior to startup so that an XSD-aware parser is available to Spring.
Please do read this resource
而resin給出來(lái)的參考就是他默認(rèn)不是使用xerces和xalan作為xml和xslt的默認(rèn)解析器
正是由于他默認(rèn)不是采用以上作為xml,xstl的解析器,導(dǎo)致了在resin下面 使用spring 2.0 新xsd配置方式會(huì)報(bào)錯(cuò)誤
(主要就是xml中的attribute和propertie 他取不到)
解決的方法就是讓resin使用xerces和xalan作為xml和xslt的默認(rèn)解析器
配置:
在resin.conf的<web-app>或者<server>節(jié)點(diǎn)下添加
<!-- xml -->
<system-property javax.xml.parsers.DocumentBuilderFactory=
???????????? "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
<system-property javax.xml.parsers.SAXParserFactory=
???????????? "org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
??
??? <!--? xslt -->
<system-property javax.xml.transform.TransformerFactory=
???????????? "org.apache.xalan.processor.TransformerFactoryImpl"/>
然后把相應(yīng)的jar加入%RESIN_HOME%/lib 目錄,這里需要說(shuō)明的是我在測(cè)試activemq的時(shí)候
加入xerces和xalan后,他包其他class無(wú)法找到,感覺(jué)好像是默認(rèn)的web-app目錄下的jar無(wú)效了,我暫時(shí)直接加入系統(tǒng)classpath解決的
這點(diǎn)不知道是不是我自己的平臺(tái)問(wèn)題。
經(jīng)過(guò)測(cè)試 resin 3.0.22+spring 2.0+activemq xsd配置方式ok了,
ps. ^.^ 以前的resin下面項(xiàng)目沒(méi)有用2.0配置,自己也學(xué)習(xí)到了新東西