why is aopalliance required?

7 views
Skip to first unread message

Pablo Fernandez

unread,
Aug 27, 2009, 6:15:26 PM8/27/09
to google-guice
Hi.

My code compiles cleanly just with the basic guice.jar but when I try
to run some test I get the following error:

java.lang.NoClassDefFoundError: [Lorg/aopalliance/intercept/
MethodInterceptor;
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
at java.lang.Class.getDeclaredMethods(Class.java:1763)
at com.google.inject.internal.ProviderMethodsModule.getProviderMethods
(ProviderMethodsModule.java:78)
at com.google.inject.internal.ProviderMethodsModule.configure
(ProviderMethodsModule.java:70)
at com.google.inject.spi.Elements$RecordingBinder.install
(Elements.java:223)
at com.google.inject.spi.Elements$RecordingBinder.install
(Elements.java:232)
at com.google.inject.AbstractModule.install(AbstractModule.java:118)


Isnt aopalliance an optional dependency that you throw in just when
you use guice AOP?

Thanks!

PD: Obviously I'm NOT using AOP, just simple DI

Bob Lee

unread,
Aug 27, 2009, 6:26:15 PM8/27/09
to google...@googlegroups.com
The AOP Alliance API is just a set of interfaces. Guice implements and references those interfaces, so they need to be in your classpath, even if you don't use that functionality.

Or, you could use the "no aop" version of Guice (available on the downloads page).

Bob 
Reply all
Reply to author
Forward
0 new messages