您的位置:首页 > 编程语言 > ASP

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
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: