posts - 9, comments - 8, trackbacks - 0, articles - 3
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

Resin 3.0.x和Spring 2.0 xsd 配置问题解决

Posted on 2007-01-03 17:53 Dr.Water 阅读(1462) 评论(1)  编辑  收藏 所属分类: Java 随手贴

Spring 官方已经提到这个错误了

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给出来的参考就是他默认不是使用xerces和xalan作为xml和xslt的默认解析器

正是由于他默认不是采用以上作为xml,xstl的解析器,导致了在resin下面 使用spring 2.0 新xsd配置方式会报错误

(主要就是xml中的attribute和propertie 他取不到)

解决的方法就是让resin使用xerces和xalan作为xml和xslt的默认解析器

配置:

在resin.conf的<web-app>或者<server>节点下添加

<!-- 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"/>


然后把相应的jar加入%RESIN_HOME%/lib 目录,这里需要说明的是我在测试activemq的时候

加入xerces和xalan后,他包其他class无法找到,感觉好像是默认的web-app目录下的jar无效了,我暂时直接加入系统classpath解决的

这点不知道是不是我自己的平台问题。


经过测试 resin 3.0.22+spring 2.0+activemq xsd配置方式ok了,


ps. ^.^ 以前的resin下面项目没有用2.0配置,自己也学习到了新东西


评论

# re: Resin 3.0.x和Spring 2.0 xsd 配置问题解决[未登录]  回复  更多评论   

2009-12-23 10:12 by
我现在遇到一个问题,resin和activemq不知如何配置,请指教。能不能把你的配置文件发出来,谢谢了。

只有注册用户登录后才能发表评论。


网站导航: