您的位置:首页 > 其它

dubbo实战---lineNumber: 13;columnNumber: 82; cvc-elt.1: Cannot find the declaration of element 'beans'

2017-12-11 20:20 549 查看

将dubbo服务发布的时候,报了如下错误:

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:Line 13 in XML document from URL[jar:file:/ServiceJars/dub-service-demo.jar!/META-INF/spring/dubbo-demo-provider.xml]is
invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 13;columnNumber: 82; cvc-elt.1: Cannot find the declaration of element 'beans'






错误原因:
因为服务器没有连接到外网,当不下来需要的jar包.
解决方法:
将dubbo的provider的配置文件的头文件中的路径改为classpath:的形式
之前的头文件:
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">[/code] 
修改后的头文件:
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans classpath:/org/springframework/beans/factory/xml/spring-beans-2.0.xsd http://code.alibabatech.com/schema/dubbo classpath:/META-INF/dubbo.xsd">


这样发布后就不会报错了..
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐