在Eclipse中新建了一个maven项目学习Spring,在 service.xml 中配置 Spring,想要学习‘面向切面的Spring’,service.xml 内容如下:

<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/shema/aop"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:c="http://www.springframework.org/schema/c"
xsi:schemaLocation="
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
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
">
<bean id="audience" class="proxy.Audience" />
<aop:config>
<aop:aspect ref="audience">
<aop:around
pointcut="execution(** concert.Performance.perform(..))"
method="watchPerformance(ProceedingJoinPoint)" />
</aop:aspect>
</aop:config>
</beans>

结果写 <aop: ** > 的时候,没有代码提示,而且总是出现错误提示:

Multiple annotations found at this line:

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

'aop:config'.

如图所示:

网上搜索解决方案,看到类似的问题是 xsi:schemaLocation 中的 url 没有配置好。思来想去,可能是因为自己在 <beans > 中的url没有写正确,就Ctrl+F 搜索‘http://www.springframework.org/schema/’,匹配的字符串就会背景高亮显示。发现果然是因为 “xmlns:aop="http://www.springframework.org/shema/aop" 没有写正确 --- shema 应该是 schema

改正以后就好了。ヾ(@@)ノ

《Spring实战》-- 'cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element' 错误的解决办法的更多相关文章

  1. Spring 错误 cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:property-placeholder'.

    我来说下这个出错的原因吧 eclise中xsd的验证问题Description Resource Path Location Type cvc-complex-type.2.4.c: The matc ...

  2. Spring Boot 调用 MongoRepository时报org.springframework.beans.factory.NoSuchBeanDefinitionException错误的解决办法

    这个问题整整折腾了我两天,现在记录下来,希望可以帮助和我一样,遇到相同问题的小伙伴. 项目是分层的(Intellij IDEA中的模块Module),有API(Core)层,Service&D ...

  3. Spring Boot连接MySQL长时间不连接后报错`com.mysql.cj.core.exceptions.ConnectionIsClosedException: No operations allowed after connection closed.`的解决办法

    报错:com.mysql.cj.core.exceptions.ConnectionIsClosedException: No operations allowed after connection ...

  4. Spring MVC Rest服务 返回json报406错误的解决办法

    @ResponseBody & @RequestBody @RequestBody 将 HTTP 请求正文插入方法中,使用适合的HttpMessageConverter将请求体写入某个对象. ...

  5. Type cvc-complex-type.2.4.c: The matching wildcard is strict...

    这个问题困扰了我两次,分别说一下原因:1. 如网上一些网友所言,是在配置Spring的标签库的时候有拼写错误或者遗漏.下面贴一个标准3.0的吧: <?xml version="1.0& ...

  6. 【Spring】The matching wildcard is strict……

    applicationContext.xml 文件抛出了这个异常信息. 解决方法: 需要在 namespace 后加上对应的 schemaLocation,如下所示: <?xml version ...

  7. Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)

    今天配置Spring的xml出现了错误 Multiple annotations found at this line: - schema_reference.4: Failed to read sc ...

  8. Spring实战拆书--SpringBean

    代码源码地址:https://github.com/wujiachengSH/springBeanDemo 概述:本章将讲解Spring对于Bean的管理方案. 目录: 准备工作 自动装配 处理装配歧 ...

  9. No Spring WebApplicationInitializer types detected on classpath 问题的一种解决办法

    今天在idea中编译部署工程,tomcat报了这个错误: No Spring WebApplicationInitializer types detected on classpath 导致前端页面访 ...

随机推荐

  1. Oracle EXPDP/IMPDP示例

    待整理: 参考DAVE博客 http://blog.csdn.net/tianlesoftware/article/details/6260138

  2. Oracle 获取本周、本月、本季、本年的第一天和最后一天

    Oracle 获取本周.本月.本季.本年的第一天和最后一天 --本周 select trunc(sysdate, 'd') + 1 from dual; select trunc(sysdate, ' ...

  3. awk将某个字段按照分隔符分割之后统计次数

    cat label_movie2|grep BBD252CC0A4FE7D10C990261D5CEACB5|awk -F "," '{for(i=2;i<NF;i++) p ...

  4. MySQL笔记(1)---MySQL体系结构和存储引擎

    1.前言 本系列记录MYSQL数据库的一些结构和实现特点,方便查询. 2.基本概念 数据库:物理操作系统文件或者其他形式文件类型的集合.MySQL中数据库文件可以是frm.MYD.MYI.ibd结尾的 ...

  5. React 安装

    1.安装 node  8.0以上 node -v npm -v 2.安装淘宝镜像 cnpm npm install -g cnpm --registry=https://registry.npm.ta ...

  6. Android内存管理篇 - 从updateOomAdjLocked看lowmemorykiller之外的Android进程回收机制

    提起android的进程回收机制,大家所熟知的是Android的lowmemroykiller的机制.当系统可用内存低于某个阀值时,即会杀死这个阀值对应的Adj值的所有应用.但是本篇文章并为是要介绍L ...

  7. [深入Maven源代码]maven绑定命令行参数到具体插件

    maven的插件 我们知道Maven具体构建动作都是由插件执行的,maven本身只是提供一个框架,这样就提供了高度可定制化的功能,我们用maven命令执行比如mvn clean package这样的命 ...

  8. new Thread与线程创建

    概要:new Thread 并不意味着已经创建了一个线程,只能说明创建一个类的对象实例而已.而真正创建线程的是start()方法,此方法将调用本地方法start0()创建本地线程,而Thread的ru ...

  9. Java的HashCode,Equal和==

    ----------------------------------------以下是分割线---------------------------------------- 我们都知道Java语言是完 ...

  10. 几种常见算法的Python实现

    1.选择排序 选择排序是一种简单直观的排序算法.它的原理是这样:首先在未排序序列中找到最小(大)元素,存放到排序序列的起始位置,然后,再从剩余未排序元素中继续寻找最小(大)元素,然后放到已排序序列的后 ...