Suresh Ram
Suresh Ram

Reputation: 1034

Aspectj method call error

I installed aspectj plugin in eclipse and then I created a new Aspectj project in which I created an java class and .aj file. I compiled it by importing the jar in in-path of Aspectj build and Runas->Java application. Then it compiles and specified advice runs successfully. Then I exported the project as a jar. Then I created a regular java project and then I imported the exported jar and then I called one of the function (for which advice is written) in the regular java project. when I run it, I got the following error

Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang/Signature

Can any one tell to resolve it and also correct me if I am wrong.

Upvotes: 0

Views: 194

Answers (2)

René Link
René Link

Reputation: 51343

The exception means that the you have a class that was compiled against the class org/aspectj/lang/Signature, but now at runtime the class is not available anymore.

Add the aspectj runtime jar to your project's classpath. You might want to download it here http://central.maven.org/maven2/aspectj/aspectjrt/1.5.4/aspectjrt-1.5.4.jar

Upvotes: 2

Jens
Jens

Reputation: 69440

Download aspectjrt.jar and add it to your classpath.

Upvotes: 2

Related Questions