360SDN.COM

首页/Java/列表

dubbo在xml中配置后中无法读取到dubbo.xsd

来源:  2018-08-07 16:21:33    评论:0点击:

xml中配置的文件如下

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.2.xsd">

 

检测xsd文件能不能读取到的方法就是输入她的xsd的url如http://www.springframework.org/schema/context/spring-context-4.2.xsd你会发现他是存在的,但是你输入http://code.alibabatech.com/schema/dubbo/dubbo.xsd发现他是不存在的。如上配置之后会报出如下错误:

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
 

 

解决方案如下:

下载一个dubbo.xsd的文件将她放在一个路径里面,然后
windows->preferrence->xml->xmlcatalog

add->catalog entry ->file system 选择刚刚下载的文件存放的路径

修改key值和xml中配置文件的http://code.alibabatech.com/schema/dubbo/dubbo.xsd 相同

保存后,在xml文件右键validate 即可。

解决方式:

eclispe-->window-->preferences-->xml catalog-->add 注意KEY 需要以/dubbo.xsd结尾,
http://code.alibabatech.com/schema/dubbo/dubbo.xsd
如下图所示


 

为您推荐

友情链接 |九搜汽车网 |手机ok生活信息网|ok生活信息网|ok微生活
 Powered by www.360SDN.COM   京ICP备11022651号-4 © 2012-2016 版权