java错误-The prefix "aop" for element "aop:aspectj-autoproxy" is not bound.
2015-08-31 14:07
323 查看
配置springmvc的aop时出错:
当我向配置文件中添加:<aop:aspectj-autoproxy proxy-target-class="true"/> 时出错:
The prefix "aop" for element "aop:aspectj-autoproxy" is not bound.
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 16 in XML document from
xmlns:aop="http://www.springframework.org/schema/aop"
和
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"
添加后如下面所示:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
/article/8139373.html
当我向配置文件中添加:<aop:aspectj-autoproxy proxy-target-class="true"/> 时出错:
The prefix "aop" for element "aop:aspectj-autoproxy" is not bound.
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 16 in XML document from
class path resource [springmvc.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The prefix "aop" for element "aop:aspectj-autoproxy"
is not bound.
解决方法:
添加这些有关AOP的配置:xmlns:aop="http://www.springframework.org/schema/aop"
和
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"
添加后如下面所示:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
spring配置文件详解:
/article/8139373.html
相关文章推荐
- Aspose.Words如何在文档中添加水印
- Aspose.Words使用教程之如何在文档中添加水印
- java错误-java.lang.ClassNotFoundException: org.aspectj.lang.annotation.Around
- 用casperjs截取任意网页区域
- phantomjs/casperjs动态传入参数
- Ubuntu安装Casperjs
- Spring AOP编程中--@aspect 标签,切面编程
- Asp.net自动生成三层代码视频教程
- ASP.NET中身份验证
- win2003中iis与asp设置Session会话过期时间的问题
- 安装ASP.net mvc3 Installation failed with error code: (0x80070643), "安装时发生严重错误 "
- asp.net批量多选文件上传解决方案
- ASP.NET温故而知新学习系列之加密解密技术—对称算法加密(一)
- ASP.NET对大文件上传的解决方案
- ASP.NET温故而知新学习系列之网站安全技术—加强页面间传值的安全性Convert.ToBase64String(三)
- ASP.NET温故而知新学习系列之网站安全技术—Web.config加密和解密(一)
- ASP.NET温故而知新学习系列之网站安全技术—预防脚本攻击(二)
- ASP.NET MVC4入门到精通系列目录汇总
- ASP.NET 开发必备知识点(2):那些年追过的ASP.NET权限管理
- ASP.NET对大文件上传的解决方案