与元素类型“beans”相关联的属性“xsi:schemaLocation”的前缀“xsi”未绑定(The prefix “xsi” for attribute “xsi:schemaLocation

编程入门 行业动态 更新时间:2024-10-07 18:23:11
与元素类型“beans”相关联的属性“xsi:schemaLocation”的前缀“xsi”未绑定(The prefix “xsi” for attribute “xsi:schemaLocation” associated with an element type “beans” is not bound)

为什么我有这个错误

[致命错误]:与元素类型“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声明的最后一行。 请问我该怎么做才能消除此错误?

Why am I having this error

[Fatal Error]: The prefix "xsi" for attribute "xsi:schemaLocation" associated with an element type "beans" is not bound.

at the header of my XML file:

<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">

The error is at the last line of my XML declaration. Please what can I do to remove this error?

最满意答案

只需添加

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

到你的bean元素来消除这个错误。

Simply add

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

to your bean element to eliminate that error.

更多推荐

本文发布于:2023-08-04 21:51:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1422310.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:前缀   相关联   绑定   属性   元素

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!