您的位置:首页 > 服装鞋帽 > 男装 > Xfire 与 Spring2.0 冲突的解决办法

Xfire 与 Spring2.0 冲突的解决办法

luyued 发布于 2011-03-05 23:51   浏览 N 次  

异常:org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".

解决方法:

由于xFire1.2包含spring1.2.6.jar包,于工程中的spring2.0.jar冲突,删除spring.1.2.6.jar 保留spring2.0.jar。

删除后仍然报错 :

org.springframework.beans.factory.BeanDefinitionStoreException: Unrecognizedxbean element mapping: beans in namespace http://xfire.codehaus.org/config/1.0

解决方法:

官方解决方法:

Spring 2.x support
Because of Spring 2.x new feature, services.xml default namespace must not be declared on the root element of configuration ( beans ) and need to be moved to tag level



意思是新的spring2.0功能中不允许将在根节点配置属性,需要将要配置的属性移到service节点。

修改services.xml

原配置文件:

Java代码 RevokeCert com.asconfig.webservice.IRevokeCert com.asconfig.webservice.RevokeCertImpl literal application RevokeCert com.asconfig.webservice.IRevokeCert com.asconfig.webservice.RevokeCertImpl literal application





修改后的配置文件

Java代码 RevokeCert com.asconfig.webservice.IRevokeCert com.asconfig.webservice.RevokeCertImpl literal application RevokeCert com.asconfig.webservice.IRevokeCert com.asconfig.webservice.RevokeCertImpl literal application

XFire与Spring冲突时

activation-1.1.jar
--commons-beanutils-1.7.0.jar
--commons-codec-1.3.jar
commons-logging-1.0.4.jar
jaxws-api-2.0.jar
jaxen-1.1-beta-9.jar
jdom-1.0.jar
--mail-1.4.jar
saaj-api-1.3.jar
saaj-impl-1.3.jar
--spring-1.2.6.jar
stax-api-1.0.1.jar
wsdl4j-1.6.1.jar
wstx-asl-3.2.0.jar
xbean-2.2.0.jar
xbean-spring-2.8.jar
xfire-aegis-1.2.6.jar
xfire-annotations-1.2.6.jar
xfire-core-1.2.6.jar
xfire-java5-1.2.6.jar
xfire-jaxws-1.2.6.jar
xfire-spring-1.2.6.jar
xfire-jsr181-api-1.0-M1.jar
jsr173_api-1.0.jar
XmlSchema-1.1.jar

commons-httpclient-3.0.jar

xfire-jaxb2-1.2.6.jar
jaxb-api-2.0.jar
jaxb-impl-2.0.1.jar
jaxb-xjc-2.0.1.jar

打--的,即有冲突的话就去掉

------------other-调用时可不要

xfire-generator-1.2.6.jar

xfire-jaxb-1.1.2.jar

xfire-ws-security-1.2.6.jar

xfire-xmlbeans-1.2.6.jar


类别:Webservice 查看评论
广告赞助商