Maven创建 dubbo配置文件错误

在创建dubbo项目,引用xml文件时,首先需要引入这几个xml文件 

1)xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"; 

2)http://code.alibabatech.com/schema/dubbo;\

3)http://code.alibabatech.com/schema/dubbo/dubbo.xsd "

但是当我们配置dubbo的时候,如 

<dubbo:application name="hello-world" />

<dubbo:registry address="multicast://224.5.6.7:1234" />  ,

会提示这些错误:

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:module'. 
- 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>.

问题在于Eclipse没有识别出相应的标签,解决办法如下:

1、选择elcipse的window-->preferences,弹出相应对话框,选择xml catalog 选择add;

2、 弹出的对话框如下;

Location: 即为我们的dubbo.xsd文件,可以在dubbo的jar包中解压获得,路径实例:D:\Program Files\Repository\Maven\com\alibaba\dubbo\2.5.3\dubbo-2.5.3\META-INF
Key Type: Schema Location
Key:      http://code.alibabatech.com/schema/dubbo/dubbo.xsd
3、点击ok,项目右键Validate;

4、Validate的时候可能会出现error,此时右键工程,选择properties,选择Validation,如下所示:

勾选Enable project specific settings选框,点击Disable All,再点击OK关闭窗口;

5、项目右键Validate,成功。

引用自https://blog.csdn.net/flourishli/article/details/54574602

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值