原因是tx没有配置好, 在Spring配置文件中, 修改Spring加载tx:annotation-driven错误
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'tx:annotation-driven'.
Spring: but no declaration can be found for element 'tx:annotation-driven'
当遇到Spring加载tx:annotation-driven时出现cvc-complex-type.2.4.c错误,原因是tx配置不完整。解决方案是在Spring配置文件中添加tx命名空间和对应的schemaLocation,确保正确引用spring-tx-2.5.xsd。
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
参考: http://forum.springframework.org/showthread.php?p=166263






