主要原因是因为xsd定义文件引用地址问题
这里出错主要在这个xsd文件:xmlns:tx="http://www.springframework.org/schema/tx"
加入即可.
下面提供一个比较全的xsd文件引用声明
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
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/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">
本文解决了Spring配置文件中xsd定义文件引用的问题,通过正确添加xsd文件的引用声明,可以有效避免因引用缺失导致的错误。
1527

被折叠的 条评论
为什么被折叠?



