在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. SQLAlchemy介绍和基本使用

    pymysql:pymysql是用Python来操作mysql的包,因此通过pip来安装,命令如下:pip3 install pymysql.如果您用的是Python 3,请安装pymysql 豆瓣源 ...

  2. List集合和Set集合的遍历方法

    Set集合遍历方法: 对 set 的遍历 1.迭代遍历: Set<String> set = new HashSet<String>(); Iterator<String ...

  3. 线程中的同步辅助类Semaphore

    同步辅助类  线程池  并发集合类 都是在线程同步的基础上增加了一些同步的东西,在线程同步的基础上更好的实现线程同步.实现的效率更高,更方便而已. 多线程并不是很难 需要你把代码写出来...然后分析运 ...

  4. centos 7 Mysql5.7 主从复制配置

    1.环境 Centos 7 Mysql 5.7 Master  192.168.1.71 Slave01 192.168.1.72 2.分别配置master,slave01 # vi /etc/my. ...

  5. 【Canal源码分析】重要类图

    从Canal的整体架构中,我们可以看出,在Canal中,比较重要的一些领域有Parser.Sink.Store.MetaManager.CanalServer.CanalInstance.CanalC ...

  6. Android在代码中获取meta标签内容

    最近写SDK需要获取<meta>标签的值,网上资料很多~分享是件好事~我很快就找到了相关资料. 下面贴上代码: ApplicationInfo appInfo = null; String ...

  7. Android返回系统Home桌面

    Intent intent = new Intent(); // 为Intent设置Action.Category属性 intent.setAction(Intent.ACTION_MAIN);// ...

  8. PTA (Advanced Level) 1007 Maximum Subsequence Sum

    Maximum Subsequence Sum Given a sequence of K integers { N​1​​, N​2​​, ..., N​K​​ }. A continuous su ...

  9. ELK批量删除索引 及 相关操作命令 - 运维小结

    线上部署了ELK+Redis日志分析平台环境, 随着各类日志数据源源不断的收集, 发现过了一段时间之后, ELK查看会原来越慢, 重启elasticsearch服务器节点之前同步时间也会很长,  这是 ...

  10. 【IT笔试面试题整理】寻找二叉树两节点的最近的公共祖先

    [试题描述] 求二叉树中任意两个节点的最近公共祖先也称为LCA问题(Lowest Common Ancestor). 二叉查找树 如果该二叉树是二叉查找树,那么求解LCA十分简单. 基本思想为:从树根 ...