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

来源:互联网 发布:java字符流写文件 编辑:程序博客网 时间:2024/06/06 13:58

将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.xsdhttp://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">


修改后的头文件:
<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.xsdhttp://code.alibabatech.com/schema/dubbo classpath:/META-INF/dubbo.xsd">

这样发布后就不会报错了..

阅读全文
1 0
原创粉丝点击