与元素类型“beans”关联的属性“xsi:schemaLocation”的前缀“xsi”未绑定

2024-03-24

为什么我会出现这个错误

[致命错误]:与元素类型“beans”关联的属性“xsi:schemaLocation”的前缀“xsi”未绑定。

在我的 XML 文件的标题处:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans      
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/tx
       http://www.springframework.org/schema/tx/spring-tx.xsd">

错误出现在我的 XML 声明的最后一行。 请问我该怎么做才能消除这个错误?


只需添加

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

to your bean元素来消除该错误。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

与元素类型“beans”关联的属性“xsi:schemaLocation”的前缀“xsi”未绑定 的相关文章

随机推荐