这两天一直纠结于关于阿里巴巴的dubbo在整合到springmvc时候出现错误,总是提示
***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文件没有配置好导致的错误,今天将步骤分享如下
有的时候,如果没有配置约束,在xml文件中就没有快捷提示,开发很不方便,下面讲一讲如何配置约束
一、DTD类型约束文件
以配置mybatis约束为例
1、window—>Preferences—>XML—>XML Catalog—>User Specified Entries窗口,点击Add按钮
2.在Add XML Catalog Entry 对话框中选择或输入以下内容:
Location: F:\soft\programmingSoft\Framework\Ibatis\sql-map-config-2.dtd
Key Type: URI
KEY: http://ibatis.apache.org/dtd/sql-map-config-2.dtd
二、XSD 类型约束文件
1、window—>Preferences—>XML—>XML Catalog—>User Specified Entries窗口,点击Add按钮
2.在Add XML Catalog Entry 对话框中选择或输入以下内容:
Location:D:\txd\dubbo.xsd
Key Type: Schema Location
KEY: http://code.alibabatech.com/schema/dubbo/dubbo.xsd