Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] NoClassDefFoundError: org/aspectj/runtime/internal/CFlowCounter

Hi all,

I'm back :-) .

In my previous e-mails to the list, I mentioned that I was doing JDK weaving and I've been fairly successful with that; that is, until today.

At this point, I have an aspect that I'm weaving into rt.jar and this aspect has two pointcuts. The first pointcut is an "auxiliary pointcut" to be used in the second pointcut as a cflow() pattern. Then, the second pointcut (but not the first) is advised by an around() advice.

In theory, everything should work fine. In fact, if I remove the cflow() restriction, everything DOES work fine. The problem is when I add the cflow() part, which makes my application start firing these:

-------------8<-------------
java.lang.NoClassDefFoundError: org/aspectj/runtime/internal/CFlowCounter
at java.lang.JDKAspect.ajc$preClinit(JDKAspect.aj:1)
at java.lang.JDKAspect.<clinit>(JDKAspect.aj)
at com.sun.xml.ws.transport.http.HttpAdapter.handle_aroundBody1$advice(HttpAdapter.java:14)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:1)
-------------8<-------------

Now, from what I've seen and from past experience, this would be just a matter of classpaths, but that does not seem to be the case. I've added the aspectjrt.jar to the Tomcat classpath (this is to be used as part of Tomcat running in a JVM) and no luck. I still get the same exceptions. It's as if the JVM is completely ignoring the aspectjrt.jar and I have absolutely no clue why. Obviously, aspectjrt.jar has the CFlowCounter class in there, so does anyone have a clue of what might be happening here?

Just to be clear, what I'm trying to do does work without the cflow() restriction but I need the cflow() to make it more self-contained, since I'm weaving into the JDK.

Thanks in advance!

Tiago

Back to the top