google-code-export / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
2 stars 1 forks source link

NoClassDefFound for aopalliance when creating an injector without aopalliance jar in classpath #283

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I never bothered to put the aopalliance jar into my project and it worked
fine in Guice 1.0.  With r734, I get this exception:

java.lang.NoClassDefFoundError: [Lorg/aopalliance/intercept/MethodInterceptor;
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
    at java.lang.Class.getDeclaredMethods(Class.java:1791)
    at
com.google.inject.internal.ProviderMethodsModule.getProviderMethods(ProviderMeth
odsModule.java:71)

I looked at this in the debugger, and it appears to be attempting to look
for provider methods in AbstractModule and failing.  Apparently the missing
dependency never mattered before because I never called this method.

Original issue reported on code.google.com by bslesinsky on 17 Dec 2008 at 3:40

GoogleCodeExporter commented 9 years ago
This is also a 1.0 problem, see http://groups.google.com/group/google-
guice/browse_thread/thread/f0831e44a3f0581e/

Original comment by robbie.v...@gmail.com on 17 Dec 2008 at 9:10

GoogleCodeExporter commented 9 years ago
Guice depends on aopalliance.jar. Trying to get Guice to work without that .jar 
is fragile and we don't support it.

Embedding these classes in our own .jar would likely annoy OSGi and Maven 
users, so I think end users just need 
to add that .jar to their classpath.

Original comment by limpbizkit on 30 Dec 2008 at 11:42