Alfred’s Computing Weblog

Alfred Java-cored Computing Weblog

java.lang.NoClassDefFoundError: org/aspectj/lang/annotation/Aspect

leave a comment »

Hits the error java.lang.NoClassDefFoundError: org/aspectj/lang/annotation/Aspect when I try to start a webapp in tomcat.

I was trying to add AOP to an existing web application. The AOP configuration I added is:

<aop:aspectj-autoproxy />

Add the AspectJ library to the classpath. The required AspectJ library are:
1. aspectjrt
2. aspectjweaver

My webapps is using Maven, so I added the dependencies to pom.xml as below:

<!-- AspectJ -->

Written by Alfred

September 14, 2011 at 10:41

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: