Java自动化测试

【Spring】org.xml.sax.SAXParseExce

2020-03-24  本文已影响0人  小笨笨的花花

问题:

org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 77; cvc-elt.1.a: 找不到元素 'beans' 的声明

解决:

用这个代码就ok; 图片中注释调代码就不行。

    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd">
image.png

相关解决办法:
1 xxx/spring-beans.xsd ">一定要有空格。//不懂

2 大多数说是jar版本的问题。但我jar包版本没问题,主要是xsi:schemalocation写错了,应该是xsi:schemaLocation。Location的L大写

上一篇 下一篇

猜你喜欢

热点阅读