Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] NoClassDefFoundError

I created a very basic test case that calls one of our methods in a
project with many classes. I do not have any aspects. If I execute it
with AspectJ enabled on the project, I get the stacktrace below. If I
turn off AspectJ Capability then it runs just fine. I looked in the
output directory and the class does exist either way.

There are some compile errors in the project but that shouldn't affect
running the code because it works when AspectJ is turned off.

Any ideas how to fix this? Thanks.


Exception in thread "main" java.lang.NoClassDefFoundError: my.DepClass
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:289)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at MyClass.main(ModelChangeTest.java:23)
Caused by: java.lang.ClassNotFoundException: my.DepClass
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:289)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 13 more



16:44:55 ===========================================================================================
16:44:55 Build kind = AUTOBUILD
16:44:55 Project=AnalystServices, kind of build requested=Incremental
AspectJ compilation
16:44:55 build: Examined delta - source file changes in required
project AnalystServices
16:44:56 Preparing for build: not going to be incremental because no
successful previous full build
16:44:56 Falling back to batch compilation
16:44:56 Preparing for build: not going to be incremental because no
successful previous full build
16:45:1 Timer event: 5740ms: Time to first compiled message
16:45:1 Timer event: 5780ms: Time to first woven message
16:45:50 AJDE Callback: finish. Was full build: true
16:45:50 Timer event: 54889ms: Total time spent in AJDE
16:45:54 Timer event: 3856ms: Create element map (0 rels in project:
AnalystServices)
16:45:55 Types affected during build = 1191
16:45:58 Timer event: 0ms: Add markers (0 markers)
16:45:58 Timer event: 62809ms: Total time spent in AJBuilder.build()
16:54:48 ===========================================================================================


Back to the top