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

Bla*_*aze 4 java xml spring xsd

为什么我有这个错误

[严重错误]:与元素类型“ 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">
Run Code Online (Sandbox Code Playgroud)

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

kjh*_*hes 6

只需添加

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Run Code Online (Sandbox Code Playgroud)

bean消除您的错误。