在跟着作淘淘商城项目时,用到了dubbo,做为一个SOA架构的项目,分为表现层与服务层,天然地,为了各个层之间解耦合(或者最大限度地松耦合),咱们使用了dubbo这样一个alibaba开源的分布式服务框架,该框架最大的特色就是利用分层的方式来架构,从服务模型的角度来看,Dubbo采用的是一种很是简单的模型,要么是提供方提供服务,要么是消费方消费服务,因此基于这一点能够抽象出服务提供方(Provider)和服务消费方(Consumer)两个角色。html
可是在appplicationContext-service.xml建立服务和在springmvc.xml中引用服务时,咱们设置了dubbo约束,可是仍然会报错,系统提示咱们找不到dubbo:application、dubbo:registry、dubbo:protocol、dubbo:reference等元素spring
具体错误以下:架构
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>.
错误以下图所示:mvc
为何呢?由于阿里的开源网站http://code.alibabatech.com,早已经挂掉了!!!app
这就说明系统没有找到dubbo.xsd,因而我手动添加dubbo.xsd约束文件。在下载的dubbo-2.5.3.jar包中存在一个文件dubbo.xsd,将此文件取出存放于电脑的磁盘的某一目录,配置加载的时候先加载本地的。以下配置便可解决。框架
在Eclipse中 Window --> Preferences分布式
保存完成后,右键相应的报红的配置文件,选择validate。稍等片刻便可解决。ide
参考连接:网站