`

aop advisor说明以及The prefix "aop" for element "aop:config" is not bound.错误原因

阅读更多

原因:我们在定义申明AOP的时候。没有加载schema。

解决:首先应该加载JAR包。

还要在<beans>中要加入“xmlns:aop”的命名申明,

并在“xsi:schemaLocation”中指定aop配置的schema的地址


配置文件如下:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans "
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
xmlns:aop="http://www.springframework.org/schema/aop "
xmlns:tx="http://www.springframework.org/schema/tx "
xsi:schemaLocation="http://www.springframework.org/schema/beans
                     http://www.springframework.org/schema/beans/spring-beans.xsd
                     http://www.springframework.org/schema/tx
                     http://www.springframework.org/schema/tx/spring-tx.xsd
                     http://www.springframework.org/schema/aop
                     http://www.springframework.org/schema/aop/spring-aop.xsd ">

(* com.test.service.*.*(..))中几个通配符的含义:

第一个 * —— 通配 任意返回值类型
第二个 * —— 通配 包com.test.service下的任意class
第三个 * —— 通配 包com.test.service下的任意class的任意方法
第四个 .. —— 通配 方法可以有0个或多个参数

综上:包com.test.service下的任意class的具有任意返回值类型、任意数目参数和任意名称的方法

分享到:
评论

相关推荐

    aop面向切面需要的jar包

    在使用spring的aop功能时,这两个jar是必须的,否则会报错,如下: Caused by: java.lang.ClassNotFoundException: org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException at java.net....

    com.springsource.net.sf.cglib-2.2.0 aop依赖包

    com.springsource.org.aspectj.weaver-1.6.8.RELEASE.jar com.springsource.org.aopalliance-1.0.0.jar com.springsource.net.sf.cglib-2.2.0.jar

    spring-aop-5.0.10.RELEASE-API文档-中文版.zip

    赠送jar包:spring-aop-5.0.10.RELEASE.jar; 赠送原API文档:spring-aop-5.0.10.RELEASE-javadoc.jar; 赠送源代码:spring-aop-5.0.10.RELEASE-sources.jar; 赠送Maven依赖信息文件:spring-aop-5.0.10.RELEASE....

    weblogic.xml

    解决AopConfigException类不存在。...Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.springframework.aop.framework.AopConfigException 解决方法是把这个文件放到WEB-INF文件夹下面

    spring-aop-5.2.0.RELEASE-API文档-中文版.zip

    赠送jar包:spring-aop-5.2.0.RELEASE.jar; 赠送原API文档:spring-aop-5.2.0.RELEASE-javadoc.jar; 赠送源代码:spring-aop-5.2.0.RELEASE-sources.jar; 赠送Maven依赖信息文件:spring-aop-5.2.0.RELEASE.pom;...

    com.springsource.org.aopalliance-1.0.0.jar.zip

    在Spring配置中,我们可以通过`&lt;aop:config&gt;`标签来定义切面,然后使用`&lt;aop:advisor&gt;`或`&lt;aop:aspect&gt;`来指定拦截器。例如: ```xml &lt;aop:config&gt; &lt;aop:aspect id="loggingAspect" ref="loggingInterceptor"&gt; ...

    11spring4_aop3.rar

    http://www.springframework.org/schema/aop/spring-aop.xsd"&gt; &lt;bean id="userService" class="cn.sxt.service.impl.UserServiceImpl"&gt; &lt;bean id="log" class="cn.sxt.log.Log"/&gt; &lt;aop:aspectj-autoproxy/&gt; ...

    springAOP demo 带错误解决文档

    nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator]: ...

    spring-aop-5.0.8.RELEASE-API文档-中英对照版.zip

    赠送jar包:spring-aop-5.0.8.RELEASE.jar; 赠送原API文档:spring-aop-5.0.8.RELEASE-javadoc.jar; 赠送源代码:spring-aop-5.0.8.RELEASE-sources.jar; 赠送Maven依赖信息文件:spring-aop-5.0.8.RELEASE.pom;...

    spring-aop-4.2.2.RELEASE-API文档-中文版.zip

    赠送jar包:spring-aop-4.2.2.RELEASE.jar; 赠送原API文档:spring-aop-4.2.2.RELEASE-javadoc.jar; 赠送源代码:spring-aop-4.2.2.RELEASE-sources.jar; 赠送Maven依赖信息文件:spring-aop-4.2.2.RELEASE.pom;...

    sisu-guice-3.1.3-no_aop.jar

    sisu-guice-3.1.3-no_aop.jar

    android aop

    Android AOP,全称为Aspect-Oriented Programming(面向切面编程),是一种编程范式,它旨在提高软件的模块化程度,通过将关注点分离到不同的切面,使得代码更易于维护和扩展。在Android开发中,AOP常用于日志记录、...

    spring-aop-5.1.3.RELEASE-API文档-中英对照版.zip

    赠送jar包:spring-aop-5.1.3.RELEASE.jar; 赠送原API文档:spring-aop-5.1.3.RELEASE-javadoc.jar; 赠送源代码:spring-aop-5.1.3.RELEASE-sources.jar; 赠送Maven依赖信息文件:spring-aop-5.1.3.RELEASE.pom;...

    Spring AOP 拦截器 Advisor

    在 `inactive-aop.xml` 配置文件中,我们可以通过 `&lt;aop:config&gt;` 和 `&lt;aop:advisor&gt;` 标签来声明和配置这个 Advisor,指定其切入点表达式。 总的来说,Spring AOP 拦截器 Advisor 是一种强大的工具,它允许我们在...

    spring-aop-4.3.20.RELEASE-API文档-中英对照版.zip

    赠送jar包:spring-aop-4.3.20.RELEASE.jar 赠送原API文档:spring-aop-4.3.20.RELEASE-javadoc.jar 赠送源代码:spring-aop-4.3.20.RELEASE-sources.jar 包含翻译后的API文档:spring-aop-4.3.20.RELEASE-...

    spring-aop.jar各个版本

    spring-aop-1.1.1.jar spring-aop-1.2.6.jar spring-aop-1.2.9.jar spring-aop-2.0.2.jar spring-aop-2.0.6.jar spring-aop-2.0.7.jar spring-aop-2.0.8.jar spring-aop-2.0.jar spring-aop-2.5.1.jar spring-aop-...

    spring1.x使用AOP实例

    最后,Spring 1.x的AOP支持还允许自定义切点表达式,这是通过实现`org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator`类并注册到Spring容器来完成的。这种方式使得基于注解的切面...

    SPRING:aspect和advisor区别

    - 这个例子展示了如何定义一个事务顾问`txAdvice`,并通过`&lt;aop:advisor&gt;`标签将其与切入点`busServiceMethods`关联起来。这表示所有符合该切入点定义的方法调用都将受到事务控制。 #### 四、Aspect与Advisor之间...

    西门子操作面板AOP30使用说明.zip

    本说明将详细介绍AOP30的主要功能、配置方法、编程及日常使用注意事项。 一、AOP30简介 西门子AOP30操作面板是一款彩色触摸屏显示器,适用于西门子SIMATIC系列PLC(可编程逻辑控制器)系统。它具备高分辨率和丰富的...

    spring aop注解方式、xml方式示例

    Spring AOP(面向切面编程)是Spring框架的重要组成部分,它提供了一种强大的方式来实现横切关注点,如日志、事务管理、性能监控等,而无需侵入业务代码。下面将详细介绍Spring AOP的注解方式和XML配置方式。 ### ...

Global site tag (gtag.js) - Google Analytics