cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration的解決


導入了一個工程,編譯什么的都還好,但是報了一個XML的錯誤。
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'. 

 

具體錯誤如下:

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>.

 

根據錯誤提示,有可能是http://code.alibabatech.com/schema/dubbo/dubbo.xsd這個文檔找不到或者打不開,於是百度了一下,發現類似問題的問還是比較多的,比較輕松找到解決辦法。大致的思路是,到網上下載一個dubbo.xsd文件,其實在dubbo的jar包里就有,直接解壓出來就好,放到本地目錄,然后在Eclipse里配置上關聯關系,讓Eclipse能找到這個文件即可。

       1、下載一個dubbo.xsd文件;
  2、在windows->preferrence->xml->xmlcatalogadd->catalog entry  ->file system 選擇剛剛下載的文件路徑;
  3、修改key值和配置文件的http://code.alibabatech.com/schema/dubbo/dubbo.xsd 相同保存。
  4、在xml文件右鍵validate就可以k解決了。

 

后記:有其它的xsd文件找不到的情況,也可以按照類似的方法解決。

 

轉自https://blog.csdn.net/ddshang/article/details/72772640


免責聲明!

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



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