Bug 460735 - NoClassDefFoundError when woven with Pertypewithin clause using @Aspect
Summary: NoClassDefFoundError when woven with Pertypewithin clause using @Aspect
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.8.5   Edit
Hardware: PC Windows 7
: P3 blocker with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-24 14:47 EST by Yogesh Thanaseelan CLA
Modified: 2015-02-24 14:47 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yogesh Thanaseelan CLA 2015-02-24 14:47:50 EST
The class file generated using iajc task misses some of the generated transient variable defintions when Pertypewithin clause is used with @Aspect annotation. This results in NoClassDefFoundError while accessing the class at runtime.

Steps:
1. write an aspect with @Aspect annotation and applicable for perTypeWithin( pattern matched using annotation ).
2. In the java file that needs to be woven, mention the annotation matching that aspect's target annotation.
3. When iajc runs, the generated class file is not complete. The class files uses some generated aspect instance variables which doesnt have any variable defintion.

This issue doesnt happen consistently and when it works fine, these variables are defined properly and they are defined as transient variables.

Will attach a sample program once I find a pattern to reproduce this problem consistently.

Since this is happening inconsistently, we couldnt use the aspects in our code base.
It works consistently when we use the default singleton instantiation approach.

We are using java 1.7 and aspectj 1.8.5. Happens with Aspectj 1.7.3 version as well.