Spring错误——Spring AOP——org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException
- 背景:学习切面,测试前置通知功能,xml配置如下
<?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:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd" > <bean id="ikAspect" class="com.jing.spring.aop.IKAspect"></bean>
<bean id="ikAspectBiz" class="com.jing.spring.aop.IKAspectBiz"></bean> <aop:config>
<aop:aspect id="ikAspectAop" ref="ikAspect">
<aop:pointcut id="ikPoint" expression="execution(* com.jing.spring.aop.IKAspectBiz.*(..))"></aop:pointcut>
<aop:before method="aspectBefore" pointcut-ref="ikPoint"></aop:before>
</aop:aspect>
</aop:config>
</beans> - 报错:org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException
Caused by: java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getConstructor0(Class.java:3075)
at java.lang.Class.getDeclaredConstructor(Class.java:2178)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:80)
... 66 more
Caused by: java.lang.ClassNotFoundException: org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 71 more - 原因:Spring AOP 虽然有自己的AOP功能,但是它是依赖
AspectJ来实现的。使用maven搭建的项目pom.xml中,没有引入aspectjweaver包。 - 解决办法:在pom.xml中引入
aspectjweaver包。<!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.9.2</version>
</dependency> - 测试成功

- Next
Spring错误——Spring AOP——org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException的更多相关文章
- Spring.之.报错:Caused by: java.lang.ClassNotFoundException: org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException
Caused by: java.lang.ClassNotFoundException: org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWo ...
- could not find class that it depends on; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
© 版权声明:本文为博主原创文章,转载请注明出处 1.问题描述 搭建SSH框架启动报错如下: 六月 07, 2017 2:34:34 下午 org.springframework.web.contex ...
- Spring3.x错误----java.lang.ClassNotFoundException:org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException
Spring3.x错误: 解决方法: 缺少aspectjweaver.jar包 下载地址: https://cn.jarfire.org/aspectjweaver.html
- Spring系列: 使用aop报错:nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$Refle
写了个最简单的aop例子 配置文件如下 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns ...
- Caused by: java.lang.ClassNotFoundException: org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWo
1.错误描述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help ...
- NoClassDefFoundError:aspectj/weaver/reflect/ReflectionWorld$Reflection
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: ...
- Spring 中基于 AOP 的 @AspectJ
Spring 中基于 AOP 的 @AspectJ @AspectJ 作为通过 Java 5 注释注释的普通的 Java 类,它指的是声明 aspects 的一种风格. 通过在你的基于架构的 XML ...
- spring学习(二) ———— AOP之AspectJ框架的使用
前面讲解了spring的特性之一,IOC(控制反转),因为有了IOC,所以我们都不需要自己new对象了,想要什么,spring就给什么.而今天要学习spring的第二个重点,AOP.一篇讲解不完,所以 ...
- Spring中基于AOP的@AspectJ
以下内容引用自http://wiki.jikexueyuan.com/project/spring/aop-with-spring-framenwork/aspectj-based-aop-with- ...
随机推荐
- 类似于Mimikatz的Linux Hash Dump工具
项目主页 https://github.com/huntergregal/mimipenguin 需要root权限 支持 Kali 4.3.0 (rolling) x64 (gdm3) Ubuntu ...
- oracle忘记密码用户名被锁定_解决方案
本方案参考http://www.cnblogs.com/iosundersunshine/p/5313174.html 解决方案(window): 进入cmd命令 按照图上五步,即可 1,输入 ech ...
- yum安装openjdk
含有的命令:yum,java -version,javac,source,vim [root@ycj ~]# yum -y install java-1.8.0-openjdk-devel //安装j ...
- JavaScript面向对象之get和set设置读写属性
之前我们通过this和prototype申明的属性都是可读写的属性,如果想实现单独控制,就必须使用get和set存取期. 基本方法的 步骤一般包含两个步骤,1,使用var关键字定义一个私有属性作为中间 ...
- Rosserial实现Windows-ROS交互操作
安装 sudo apt-get install ros-indigo-rosserial-windows sudo apt-get install ros-indigo-rosserial-serve ...
- 用php的chr和ord函数实现字符串和ASCII码互转
http://shenyongqang.blog.163.com/blog/static/22439113201002941856838/ chr和ord函数是用来字符串和ASCII码互转的. ASC ...
- ORACLE中关于使用between在MyBatis中取不同的区间值和取反
最近在项目中使用between取不同的区间值问题,由于区间跨度大,而且区间多,又是前端传过来的参数,所以使用in和exists比较麻烦.然后就考虑使用between.现将使用方法记录一下. 假如表有个 ...
- Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:443
(1)端口被占用,找到对应的进行并结束.(2)Linux下查看,无进程占用443端口,确认/etc/httpd/conf.d下只有一个ssl.conf,无其他SSL配置.备份文件,如果有,apache ...
- HBase笔记4(调优)
Master/Region Server调优 JVM调优 默认的RegionServer内存是1G,而Memstore默认占40%,即400M,实在是太小了,可以通过HBASE_HEAPSIZE参数修 ...
- Python学习笔记(1)__name__变量
这是我在网上找到的一篇文章的标题. 本着学会了才是自己的,所以标题不变,自己试着再写一遍. 问题:__name__是什么? 背景:在学习编程规范的时候,我被要求函数的调用只能在__main()函数中使 ...