We are using aspectj (1.8.5) with Java (1.7) and Spring (3.2.3). We use load time weaving. Once in a while we see these errors is the log of our application when it starts. Sometimes the start up of the application fails (due to the errors) and sometimes the application starts correctly.
The error:
ERROR TaskUtils.java:95 - Unexpected error occurred in scheduled task. java.lang.NoClassDefFoundError: org/aspectj/runtime/reflect/JoinPointImpl at org.aspectj.runtime.reflect.Factory.makeJP(Factory.java:164) ~[aspectjweaver-1.8.5.jar:1.8.5]
This occurs multiple times for about half a minute and then the application succeeds to overcome this or not.
Perhaps that fact that we're running on Spring might cause some interference?
applicationContext.xml:
<context:load-time-weaver aspectj-weaving="on"/>
Tomcat's context.xml:
<Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/>
In our pom.xml we have these dependencies (related to aspectJ and spring aop):
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-instrument-tomcat</artifactId>
<version>${springframework.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.5</version>
</dependency>
Can someone please shed some light on this?
Thank you.