zoukankan      html  css  js  c++  java
  • spring整合xfire出现Document root element "beans", must match DOCTYPE root "null"错误解决方案

    fire自带的包下有个spring1.2.6的jar包,而工程的jar包是2.0的。

    解决方案:

    1.将原配置文件的头schema方式换为DOCTYPE方式,原配置文件如下(非maven)

    [java] view plain copy
     
    1. <?xml version="1.0" encoding="UTF-8"?>  
    2. <beans  
    3.     xmlns="http://www.springframework.org/schema/beans"  
    4.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
    5.     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">  
    6.   
    7.     <bean id="helloWS" class="com.HelloWorld"/>  
    8.     <bean id="addressingHandler" class="org.codehaus.xfire.addressing.AddressingInHandler"/>  
    9.     <bean name="helloService" class="org.codehaus.xfire.spring.ServiceBean">  
    10.         <property name="serviceBean" ref="helloWS"/>  
    11.         <property name="serviceClass" value="com.IHelloWorld"/>  
    12.         <property name="inHandlers"><list><ref bean="addressingHandler"/></list></property>  
    13. </bean>  
    14.   
    15. </beans>  

    改成:

    [java] view plain copy
     
    1. <?xml version="1.0" encoding="UTF-8"?>  
    2. <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">  
    3. <beans>  
    4.   
    5.     <bean id="helloWS" class="com.HelloWorld"/>  
    6.     <bean id="addressingHandler" class="org.codehaus.xfire.addressing.AddressingInHandler"/>  
    7.       
    8.     <bean name="helloService" class="org.codehaus.xfire.spring.ServiceBean">  
    9.         <property name="serviceBean" ref="helloWS"/>  
    10.         <property name="serviceClass" value="com.IHelloWorld"/>  
    11.         <property name="inHandlers"><list><ref bean="addressingHandler"/></list></property>  
    12. </bean>  
    13.   
    14. </beans>  

    2.maven环境下建pom.xml的xfire调整以下:

    <!-- xfire 1.2.6 -->
    <dependency>
    <groupId>org.codehaus.xfire</groupId>
    <artifactId>xfire-spring</artifactId>
    <version>1.2.6</version>
    <exclusions>
    <exclusion>
    <groupId>org.springframework</groupId>
    <artifactId>spring</artifactId>
    </exclusion>
    </exclusions>
    </dependency>

    重新发布即可

  • 相关阅读:
    C#中使用事务
    C#中执行数据库存储过程
    构建ASP.net的AJAX开发环境
    C#开发数据库技巧汇总
    索引的作用及其使用
    C#中的多态性
    C#中调用C++的DLL
    不借助其它变量交换两变量值
    ASP.NET页面间传值的9种方式
    TERSUS无代码开发(笔记11)TERSUS框架学习框架基本信息修改
  • 原文地址:https://www.cnblogs.com/antyi/p/6709032.html
Copyright © 2011-2022 走看看