java错误-The prefix "aop" for element "aop:aspectj-autoproxy" is not bound.

配置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配置文件详解

http://blog.csdn.net/zzjjiandan/article/details/22922847

版权声明:本文为博主原创文章,未经博主允许不得转载。

时间: 2024-07-30 10:04:04

java错误-The prefix "aop" for element "aop:aspectj-autoproxy" is not bound.的相关文章

The prefix &quot;aop&quot; for element &quot;aop:aspectj-autoproxy&quot; is not bound.

在使用spring  aop的时候报错了:The prefix "aop" for element "aop:aspectj-autoproxy" is not bound.原因是有一些地址没有被引入: 以下是一个完整配置AOP的例子. 首先是文件项目结构: SpringAOPTest.java import java.util.ArrayList; import java.util.List; import org.junit.Test; import org.s

ssm-异常:The prefix &quot;aop&quot; for element &quot;aop:config&quot; is not bound.

今天在搭建ssm环境时出现异常:The prefix "aop" for element "aop:config" is not bound. 原因:applicationContext.xml文件头没有添加 xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/aop

Java实战之03Spring-03Spring的核心之AOP(Aspect Oriented Programming 面向切面编程)

三.Spring的核心之AOP(Aspect Oriented Programming 面向切面编程) 1.AOP概念及原理 1.1.什么是AOP OOP:Object Oriented Programming面向对象编程 AOP:Aspect Oriented Programming面向切面编程 1.2.代理 充分理解:间接 主要作用:拦截被代理对象执行的方法,同时对方法进行增强. 1.2.1.静态代理 特点:代理类是一个真实存在的类.装饰者模式就是静态代理的一种体现形式. 1.2.2.动态代

Chapter 4: Spring and AOP:Spring&#39;s AOP Framework

Spring's AOP Framework Let's begin by looking at Spring's own AOP framework — a proxy-based framework that works in pure Java. You can use it in any application server and all the required classes are included in the Spring distribution. Although man

The prefix "tx" for element "tx:advice" is not bou

The prefix "tx" for element "tx:advice" is not bound 这个错误的原因很简单是: 我们在定义申明AOP的时候..没有加载schema. 具体表现如下: <beans> <tx:advice id="txAdvice" transaction-manager="transactionManager">         <tx:attributes&g

The prefix &quot;tx&quot; for element &quot;tx:annotation-driven &quot; is not bound

The prefix "tx" for element "tx:advice" is not bound 这个错误的原因很简单是: 我们在定义申明AOP的时候..没有加载schema. <beans>中要加入“xmlns:aop”的命名申明,并在“xsi:schemaLocation”中指定aop配置的schema的地址 配置文件如下: <?xml version="1.0" encoding="UTF-8"

Spring配置文件标签报错:The prefix &quot;XXX&quot; for element &quot;XXX:XXX&quot; is not bound. .

例如:The prefix "context" for element "context:annotation-config" is not bound. 这种情况是因为没有申明该标签,然后就使用了.解决方发是,在配置文件头部加入相应的信息即可( 即xmlns:context="http://www.springframework.org/schema/context"). 这种情况是因为没有申明该标签,然后就使用了.解决方发是,在配置文件头部加

初识Aop和扩展Aop

一.什么叫做AOp 解析:Aop(Aspect Oriented Programming)是面向切面编程,软件编程的一种思想. OOp(Object Oriented Programming)是面向对象编程. Aop是基于OOp的,又高于OOp. 二.区别 面向对象编程是从[静态角度]考虑程序的结构,而面向切面编程是从[动态角度]考虑程序运行过程. AOP底层,就是采用[动态代理]模式实现的.采用了两种代理:JDK动态代理和CGLIB动态代理. 三.切入点表达式 execution([modif

标准AOP与Spring AOP

AOP介绍 在AOP联盟的官方网站里(http://aopalliance.sourceforge.net/) AOP是一种能够增强多种已存在的中间件环境(such as J2EE)或者开发环境(e.g. Eclipse)功能的编程技术. AOP 实现方式与相关项目 关于AOP在很多项目中都有实现,实现的方式也有不同,目前主要有三种处理方式:Proxy(代理), Interceptor(拦截器), bytecode translator(字节码翻译). AOP相关的项目有: ASM: a lig