Skip to main content

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

Not being entirely familiar with the maven aspectj plugin, I can't say
what is going on here (maybe someone else on this list will have a
better idea).

It seems that your compile time classpath and your runtime classpath
are somehow different.

What are the exact command and classpath being run to compile?  Try
adding the -showWeaveInfo option to ajc and it will tell you what gets
woven.

What are the exact command and classpath being run to execute the jar?

Can you try compiling and running outside of maven (ie- from the
command line)?

Can you send the relevant snippets of the pom.xml?

Can't be of much help other than that right now.

--a

On Fri, May 22, 2009 at 11:53 AM, Dimittry <dimittry@xxxxxxxxx> wrote:
> 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!
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top