【问题标题】:The prefix "xsi" for attribute "xsi:schemaLocation" associated with an element type "beans" is not bound与元素类型“beans”关联的属性“xsi:schemaLocation”的前缀“xsi”未绑定
【发布时间】:2016-10-12 17:38:52
【问题描述】:

为什么会出现这个错误

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

【问题讨论】:

    标签: java xml spring xsd


    【解决方案1】:

    简单添加

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

    到您的 bean 元素以消除该错误。

    【讨论】:

    • 也适合我!
    猜你喜欢
    • 2018-09-12
    • 1970-01-01
    • 2015-06-14
    • 2020-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-05
    相关资源
    最近更新 更多