spring通过xml方式配置AOP时,提示错误信息:匹配的通配符是严格的,但是对于元素'aop:aspectj- 自动代理”。

来源:互联网 发布:如何清除mac桌面图标 编辑:程序博客网 时间:2024/06/10 07:42

在spring中配置AOP切面时,提示错误信息

- cvc-complex-type.2.4.c: - The matching wildcard is strict, - but no declaration can be found for element 'aop:aspectj-autoproxy'.

是由于Spring 配置文件中的顺序颠倒引起的,将

xsi:schemaLocation=http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/aop

顺序调整为

xsi:schemaLocation=http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd 
原创粉丝点击