柰茶 2019-09-21 09:48 采纳率: 0%
浏览 2220

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

最近做AOP测试,标签一直报错:
图片说明

所报错误信息就是:cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'aop:config'.

我已经在xmlns,xsi:schemaLocation.配置aop的约束了,已经namespaces内也勾选上了aop:

图片说明

程序依旧无法识别,该如何解决呢?

  • 写回答

2条回答 默认 最新

  • Json-Huang 2019-09-21 10:21
    关注

    applicationContext.xml中配置有问题,aop:config下的aop:pointcut应该跟aop:aspect是同级别的,应该是兄弟关系,不是父子关系,类似下面

    <aop:config>
            <aop:pointcut id="loggerCutpoint"
                expression=
                "execution(* com.how2java.service.ProductService.*(..)) "/>
    
            <aop:aspect id="logAspect" ref="loggerAspect">
                <aop:after pointcut-ref="loggerCutpoint" method="log"/>
            </aop:aspect>
      </aop:config>
    
    评论

报告相同问题?

悬赏问题

  • ¥35 平滑拟合曲线该如何生成
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集