The prefix “xsi” for attribute “xsi:schemaLocation” associated with an element type “beans” is not bound

青春壹個敷衍的年華 提交于 2020-05-26 05:06:04

问题


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?


回答1:


Simply add

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

to your bean element to eliminate that error.



来源:https://stackoverflow.com/questions/37770495/the-prefix-xsi-for-attribute-xsischemalocation-associated-with-an-element-t

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!