Unable to locate Spring NamespaceHandler for XMLschemanamespace http://dubbo.apache.org/schema/dubbo


Spring通過XML整合dubbo的過程控制台包如下錯誤:

    Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://dubbo.apache.org/schema/dubbo]

配置如下:

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://dubbo.apache.org/schema/dubbo" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd"> 
<dubbo:application name="hello-world-app" /> 
<dubbo:registry address="multicast://224.5.6.7:1234" />
 <dubbo:protocol name="dubbo" port="20880" /> 
<dubbo:service interface="com.alibaba.dubbo.demo.DemoService" ref="demoServiceLocal" /> <dubbo:reference id="demoServiceRemote" interface="com.alibaba.dubbo.demo.DemoService" /> </beans>

 

最后發現從http://dubbo.apache.org/zh-cn/docs/user/configuration/xml.html網站復制的有問題

 將 http://dubbo.apache.org/schema/dubbo/dubbo.xsd

上面配置為這個一直報錯,改為以下

http://code.alibabatech.com/schema/dubbo/dubbo.xsd   

正確配置:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans.xsd 
     http://code.alibabatech.com/schema/dubbo
     http://code.alibabatech.com/schema/dubbo/dubbo.xsd">

 

微信公眾號

                          


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM