SpringMVC+MyBatis - 3 ClassNotFoundException: Org.Aspectj.Weaver.Reflect.ReflectionWorld$Reflection

SpringMVC+MyBatis - 3 ClassNotFoundException: Org.Aspectj.Weaver.Reflect.ReflectionWorld$Reflection

caused by: java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.getDeclaredConstructor(Unknown Source)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:78)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1030)
      47 more
Caused by: java.lang.ClassNotFoundException: org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
      53 more

下载最新版aspectj1.8.1
<dependency>
    <groupId>org.aspectj</groupId>
    <artifactId>aspectjrt</artifactId>
    <version>1.8.1</version>
</dependency>
结果不成功,发现是版本问题 (因为没有这个类 ReflectionWorld)

下载
<dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <version>${spring.version}</version>
</dependency>
成功

你可能感兴趣的:(SpringMVC+MyBatis - 3 ClassNotFoundException: Org.Aspectj.Weaver.Reflect.ReflectionWorld$Reflection)