"通配符的匹配很全面, 但无法找到元素 'tx:annotation-driven' 的声明" 的解决方案
2015-10-19 10:35
281 查看
在 SpringMVC 的配置文件中,一般会出现这个错误,即通配符的匹配很全面, 但无法找到元素 XXX:XXX 。
出现这样错误的原因一般就是因为xml文件的问题。
如果在头文件中没有引入
在xml中就会直接报错提示你
如果这行代码引入了,还是依旧报这个错,这就说明
如下:
出现这样错误的原因一般就是因为xml文件的问题。
如果在头文件中没有引入
xmlns:mvc="http://www.springframework.org/schema/mvc"
在xml中就会直接报错提示你
如果这行代码引入了,还是依旧报这个错,这就说明
xsi:schemaLocation没有写。
如下:
<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:jee="http://www.springframework.org/schema/jee" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation="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-4.2.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.2.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd">[/code]
上下要保证一致才不会报错。
相关文章推荐
- debug run product -strings and gcore
- 云计算
- 【转】其实你不知道MultiDex到底有多坑
- 使用jekyll主题
- Android解决APP启动白屏或者黑屏闪现的问题
- top命令详解(转,详细)
- 程序调优
- tomcat启动maven项目
- 相册或相机返回图片,进行裁剪
- c语言的文件操作
- 如何将编辑整理好的word文档转换成pdf格式
- leetcode --Reverse Bits
- 地理编码/反地理编码
- Magento根据sku查询在历史订单中的销售价格的SQL
- React.js model
- 【Android Studio】解决adb not responding if youd like to retry...错误
- import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;报错
- tar: Error is not recoverable: exiting now
- 推送
- java 序列化