今天在写dubbo配置文件的时候,无论怎样配置文件就是出错,后来在网上看到一种方法特此记录下来,分享给所有学习路上的同学
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
<!-- Application name -->
<dubbo:application name="" />
<!-- registry address, used for service to register itself -->
<dubbo:registry address="" />
<!-- expose this service through dubbo protocol, through port 20880 -->
<dubbo:protocol name="dubbo" port="20880" />
<!-- which service interface do we expose? -->
<dubbo:service interface="" ref="" />
<!-- bean配置 -->
<bean id=""
class="">
</bean>
</beans>
这是dubbo一些基本的配置实例,但有些情况会报错,解决方法如下
右键Window ->preference->xml->xmlcatalog
然后设置key的值为http://code.alibabatech.com/schema/dubbo/dubbo.xsd
然后保存关闭
在dubbo-provide.xml 右键validate即可。