cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:reference'.
具體錯誤如下:
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:reference'.
- 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>.
根據錯誤提示,有可能是http://code.alibabatech.com/schema/dubbo/dubbo.xsd這個文檔找不到或者打不開,大致的思路是,到網上下載一個dubbo.xsd文件,其實在dubbo的jar包裏就有,直接解壓出來就好,放到本地目錄,然後在Eclipse裏配置上關聯關係,讓Eclipse能找到這個文件即可。
1、下載一個dubbo.xsd文件或者找到dubbo-2.5.3.jar包,解壓,找到META_INF->dubbo.xsd
2、在windows->preferrence->xml->xmlcatalogadd->catalog entry ->file system 選擇剛剛下載的文件路徑;
3、修改key值和配置文件的http://code.alibabatech.com/schema/dubbo/dubbo.xsd 相同保存。
4、在xml文件右鍵validate就可以解決了。