Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] [aspectj plugin] Weaving results in NoClassDefFoundError

Hello everyone!
I hope someone could help me with using maven2 aspectj plugin.
The problem is that I have two projects: A and B, that are components of
my application.
Component A uses classes from B and depends on component B:
       <dependency>
           <groupId>wsmx</groupId>
           <artifactId>wsmx-grounding</artifactId>
           <version>1.0-SNAPSHOT</version>
       </dependency>

I have some aspect XX, that I apply to A. XX has nothing to do with any
classes in B.
When I compile and package A and B (jar) - everything works fine.
But when I weave XX to A - it refuses to run, and shows
NoClassDefFoundError for a class W which is in B.
I have no idea how could those two collate!
It seems that somehow aspect weaving damages th classpath, although I
have class B in both classpaths of A.
Also ajc is run by maven plugin with classpath containing project B.

If I explicitly add to A.jar compiled .class files of project B (that is
- duplicate it) - it works fine with woven aspects.
But without aspects it works without this addition! It has it in
classpath and takes the classes from loaded component B.

Any ideas? My mind is close to explosion!



Back to the top