在跟着作淘淘商城項目時,用到了dubbo,做爲一個SOA架構的項目,分爲表現層與服務層,天然地,爲了各個層之間解耦合(或者最大限度地鬆耦合),咱們使用了dubbo這樣一個alibaba開源的分佈式服務框架,該框架最大的特色就是利用分層的方式來架構,從服務模型的角度來看,Dubbo採用的是一種很是簡單的模型,要麼是提供方提供服務,要麼是消費方消費服務,因此基於這一點能夠抽象出服務提供方(Provider)和服務消費方(Consumer)兩個角色。html
可是在appplicationContext-service.xml建立服務和在springmvc.xml中引用服務時,咱們設置了dubbo約束,可是仍然會報錯,系統提示咱們找不到dubbo:application、dubbo:registry、dubbo:protocol、dubbo:reference等元素spring
具體錯誤以下:架構
Multiple annotations found at this line: - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'. - schema_reference.4: Failed to read schema document 'http://code.alibabatech.com/schema/dubbo/dubbo.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
錯誤以下圖所示:mvc
爲何呢?由於阿里的開源網站http://code.alibabatech.com,早已經掛掉了!!!app
這就說明系統沒有找到dubbo.xsd,因而我手動添加dubbo.xsd約束文件。在下載的dubbo-2.5.3.jar包中存在一個文件dubbo.xsd,將此文件取出存放於電腦的磁盤的某一目錄,配置加載的時候先加載本地的。以下配置便可解決。框架
在Eclipse中 Window --> Preferences分佈式
保存完成後,右鍵相應的報紅的配置文件,選擇validate。稍等片刻便可解決。ide
參考連接:網站