配置dubbo服務(wù)xml后匠楚,程序能正常執(zhí)行画机,但validate會出現(xiàn)一些異常:
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>
解決辦法:
- 下載dubbo的jar包盛卡,比如:dubbo-2.5.3.jar,解壓能獲取到dubbo.xsd
- 在eclipse中導(dǎo)入文件dubbo.xsd: windows->preferrence->xml->xmlcatalog, add->catalog entry ->file system 選擇文件dubbo.xsd 添加后唆香,Key默認(rèn)是這樣的:
圖片1
- 修改key值為:http://code.alibabatech.com/schema/dubbo/dubbo.xsd嫌变,因?yàn)閤ml配置文件中xsi:schemaLocation的也是這個(gè)值,保持一致躬它,重新validate腾啥,異常消失
圖片2