Sporadic NoClassDefFoundError for org/aspectj/runtime/reflect/JoinPointImpl

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Sporadic NoClassDefFoundError for org/aspectj/runtime/reflect/JoinPointImpl

Alex Shapilov
Hello,

My name is Alex, I've been using aspectJ in my project at work for quite some time now. Recently we've come across an issue that seems to be unanswered on the web. 
This is my first post to his mailing list, so I apologize in advance for any misbehavior from my side.

The issue is as follows:
  1. We are using aspectj (1.8.5) with Java (1.7) and Spring (3.2.3).
  2. We use load time weaving.
  3. 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:
    31 Jul 2015 15:00:39.061 [taskScheduler-10] 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]

    at com.vasona.agent.SmartNodeGapAgent.monitorGaps(SmartNodeGapAgent.java:1) ~[SmartNodeGapAgent.class:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_65]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_65] 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_65]
    at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_65]
  4. This occurs multiple times for about half a minute and then the application succeeds to overcome this or not. 
Our application has run successfully with aspectJ (still does, except in the above mentioned case), so I assume that all relevant configurations (aop.xml, applicationContext.xml, pom.xml, etc....) were made correctly.

Can someone please assist with this?

Thank you in advance for your time and attention.

Alex
--
Alex Shapilov
Software Developer


skype: alex.shapilov

_______________________________________________
aspectj-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-dev
Reply | Threaded
Open this post in threaded view
|

Re: Sporadic NoClassDefFoundError for org/aspectj/runtime/reflect/JoinPointImpl

Andy Clement
hi Alex,

I’m finding it tricky to understand how org.aspectj.runtime.reflect.Factory can’t find org.aspectj.runtime.reflect.JoinPointImpl - when they both originate from the same file (aspectjrt.jar) (they are in the weaver jar too). Is the loadtime weaving you are doing perhaps instrumenting anything that could be damaging or interfering with class lookup/loading?

I wonder if the behavior would be affected by putting aspectjrt.jar on the bootclasspath? That way there is no excuse for not finding it?

Any other agents running in addition to the LTW agent?

cheers,
Andy


On Aug 4, 2015, at 5:31 AM, Alex Shapilov <[hidden email]> wrote:

Hello,

My name is Alex, I've been using aspectJ in my project at work for quite some time now. Recently we've come across an issue that seems to be unanswered on the web. 
This is my first post to his mailing list, so I apologize in advance for any misbehavior from my side.

The issue is as follows:
  1. We are using aspectj (1.8.5) with Java (1.7) and Spring (3.2.3).
  2. We use load time weaving.
  3. 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:
    31 Jul 2015 15:00:39.061 [taskScheduler-10] 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]

    at com.vasona.agent.SmartNodeGapAgent.monitorGaps(SmartNodeGapAgent.java:1) ~[SmartNodeGapAgent.class:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_65]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_65] 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_65]
    at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_65]
  4. This occurs multiple times for about half a minute and then the application succeeds to overcome this or not. 
Our application has run successfully with aspectJ (still does, except in the above mentioned case), so I assume that all relevant configurations (aop.xml, applicationContext.xml, pom.xml, etc....) were made correctly.

Can someone please assist with this?

Thank you in advance for your time and attention.

Alex
--
Alex Shapilov
Software Developer


skype: alex.shapilov
_______________________________________________
aspectj-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-dev


_______________________________________________
aspectj-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-dev
Reply | Threaded
Open this post in threaded view
|

Re: Sporadic NoClassDefFoundError for org/aspectj/runtime/reflect/JoinPointImpl

Alex Shapilov
Hi Andy,

Thank you for your quick response.

Perhaps that fact that we're running on Spring might cause some interference?

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>

applicationContext.xml:
<context:load-time-weaver  aspectj-weaving="on"/>

Another reference is this:
<Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/>
in Tomcat's context.xml

Is any of this suspicious?

Thank you,
Alex


On Tue, Aug 4, 2015 at 10:17 PM, Andy Clement <[hidden email]> wrote:
hi Alex,

I’m finding it tricky to understand how org.aspectj.runtime.reflect.Factory can’t find org.aspectj.runtime.reflect.JoinPointImpl - when they both originate from the same file (aspectjrt.jar) (they are in the weaver jar too). Is the loadtime weaving you are doing perhaps instrumenting anything that could be damaging or interfering with class lookup/loading?

I wonder if the behavior would be affected by putting aspectjrt.jar on the bootclasspath? That way there is no excuse for not finding it?

Any other agents running in addition to the LTW agent?

cheers,
Andy


On Aug 4, 2015, at 5:31 AM, Alex Shapilov <[hidden email]> wrote:

Hello,

My name is Alex, I've been using aspectJ in my project at work for quite some time now. Recently we've come across an issue that seems to be unanswered on the web. 
This is my first post to his mailing list, so I apologize in advance for any misbehavior from my side.

The issue is as follows:
  1. We are using aspectj (1.8.5) with Java (1.7) and Spring (3.2.3).
  2. We use load time weaving.
  3. 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:
    31 Jul 2015 15:00:39.061 [taskScheduler-10] 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]

    at com.vasona.agent.SmartNodeGapAgent.monitorGaps(SmartNodeGapAgent.java:1) ~[SmartNodeGapAgent.class:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_65]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_65] 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_65]
    at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_65]
  4. This occurs multiple times for about half a minute and then the application succeeds to overcome this or not. 
Our application has run successfully with aspectJ (still does, except in the above mentioned case), so I assume that all relevant configurations (aop.xml, applicationContext.xml, pom.xml, etc....) were made correctly.

Can someone please assist with this?

Thank you in advance for your time and attention.

Alex
--
Alex Shapilov
Software Developer


skype: alex.shapilov
_______________________________________________
aspectj-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-dev


_______________________________________________
aspectj-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-dev



--
Alex Shapilov
Software Developer


skype: alex.shapilov



_______________________________________________
aspectj-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-dev
Reply | Threaded
Open this post in threaded view
|

Re: Sporadic NoClassDefFoundError for org/aspectj/runtime/reflect/JoinPointImpl

Andy Clement
Hmm, it might be. I’m more familiar with javaagent attachment of the weaver rather than through spring. I know there is a bunch of the spring guys watching stack overflow if you wanted to ask over there you could get their attention. If we got no luck with that I can try to prod some of them more directly. You could still try with aspectjrt.jar/aspectjweaver.jar on the bootclasspath for the VM - it may act as a temporary workaround for the problem whilst we get to the bottom of it.

cheers,
Andy

On Aug 5, 2015, at 5:50 AM, Alex Shapilov <[hidden email]> wrote:

Hi Andy,

Thank you for your quick response.

Perhaps that fact that we're running on Spring might cause some interference?

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>

applicationContext.xml:
<context:load-time-weaver  aspectj-weaving="on"/>

Another reference is this:
<Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/>
in Tomcat's context.xml

Is any of this suspicious?

Thank you,
Alex


On Tue, Aug 4, 2015 at 10:17 PM, Andy Clement <[hidden email]> wrote:
hi Alex,

I’m finding it tricky to understand how org.aspectj.runtime.reflect.Factory can’t find org.aspectj.runtime.reflect.JoinPointImpl - when they both originate from the same file (aspectjrt.jar) (they are in the weaver jar too). Is the loadtime weaving you are doing perhaps instrumenting anything that could be damaging or interfering with class lookup/loading?

I wonder if the behavior would be affected by putting aspectjrt.jar on the bootclasspath? That way there is no excuse for not finding it?

Any other agents running in addition to the LTW agent?

cheers,
Andy


On Aug 4, 2015, at 5:31 AM, Alex Shapilov <[hidden email]> wrote:

Hello,

My name is Alex, I've been using aspectJ in my project at work for quite some time now. Recently we've come across an issue that seems to be unanswered on the web. 
This is my first post to his mailing list, so I apologize in advance for any misbehavior from my side.

The issue is as follows:
  1. We are using aspectj (1.8.5) with Java (1.7) and Spring (3.2.3).
  2. We use load time weaving.
  3. 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:
    31 Jul 2015 15:00:39.061 [taskScheduler-10] 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]

    at com.vasona.agent.SmartNodeGapAgent.monitorGaps(SmartNodeGapAgent.java:1) ~[SmartNodeGapAgent.class:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_65]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_65] 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_65]
    at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_65]
  4. This occurs multiple times for about half a minute and then the application succeeds to overcome this or not. 
Our application has run successfully with aspectJ (still does, except in the above mentioned case), so I assume that all relevant configurations (aop.xml, applicationContext.xml, pom.xml, etc....) were made correctly.

Can someone please assist with this?

Thank you in advance for your time and attention.

Alex
--
Alex Shapilov
Software Developer


skype: alex.shapilov
_______________________________________________
aspectj-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-dev


_______________________________________________
aspectj-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-dev



--
Alex Shapilov
Software Developer


skype: alex.shapilov


_______________________________________________
aspectj-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-dev


_______________________________________________
aspectj-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-dev