`

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....

    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;...

    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

    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-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-...

    Spring aop 之 静态代理 动态代理 Aspectj aop-config 等实现方式

    主要对Spring AOP的相关概念和简单的静态代理、动态代理以及常见的几种AOP配置方式做总结学习。主要包括:1. AOP的常见概念 2. 静态代理 3. jdk动态代理 4. Aspectj and Aspectjweaver 5. **aop-config** 6. CGLIB ...

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

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

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

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

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

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

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

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

    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-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-5.2.7.RELEASE-API文档-中英对照版.zip

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

Global site tag (gtag.js) - Google Analytics