在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. CentOS6.8 安装 Oracle11.2.0.4

    1. 安装操作系统 安装的时候选择中文+英文支持 注意分区: swap sda盘做系统盘 sdb盘做数据盘 配置完成后的服务器分区路径信息: [root@dbserver ~]# df -h File ...

  2. 使用.NetCore在Linux上写TCP listen 重启后无法绑定地址

    拥抱.net core的过程中, 将公司的一套java项目改成了.net core 2.0版的. 里面的tcp服务被我用msdn的SocketAsyncEventArgs方式重写了, 然而在测试的过程 ...

  3. Storm的acker确认机制

    Storm的acker消息确认机制... ack/fail消息确认机制(确保一个tuple被完全处理) 在spout中发射tuple的时候需要同时发送messageid,这样才相当于开启了消息确认机制 ...

  4. @RequestParam注解

    SpringMVC的参数指定注解:@RequestParam,有下面四个方法:   value 参数绑定,value里写的是URL里参数名称 name 同上 required 是否必需参数,默认为tr ...

  5. Git for Windows之推送本地版本库到远程仓库

    Git for Windows之基础环境搭建与基础操作中介绍了Git基本环境的构建与基本的操作.生成了一个本地git版本库,本文将介绍如何将这个版本库推送到远程仓库(码云,github也可以). 1. ...

  6. 只用一招,让你Maven依赖下载速度快如闪电

    一.背景 众所周知,Maven对于依赖的管理让我们程序员感觉爽的不要不要的,但是由于这货是国外出的,所以在我们从中央仓库下载依赖的时候,速度如蜗牛一般,让人不能忍,并且这也是大多数程序员都会遇到的问题 ...

  7. gridvew使用技巧2

    GridVew1_RowDataBindGridView1.DataKeys[e.Row.RowIndex].Values[].ToString(); foreach (GridViewRow t i ...

  8. 生成对抗网络(GAN)

    基本思想 GAN全称生成对抗网络,是生成模型的一种,而他的训练则是处于一种对抗博弈状态中的. 譬如:我要升职加薪,你领导力还不行,我现在领导力有了要升职加薪,你执行力还不行,我现在执行力有了要升职加薪 ...

  9. Maven 入门——认识 Maven

    Maven /ˈmāvən/ ,可以翻译成"专家",是一款来自 Apache 组织的开源项目,用于项目管理.主要服务于基于 Java 平台的项目构建.依赖管理和项目信息管理. 构建 ...

  10. 【杂谈】从CGI到Servlet

    访问服务器的静态页面 每个Web服务器都运行着一个HTTP服务软件,用于响应web浏览器的请求,返回客户想要的页面.HTTP服务器都会有一个文件夹用于放置相关的页面文件,默认是  /user/loca ...