I forgot to mention the context. What is going on is that my application tries to inject a class called MultiPartReader, which in turn depends upon JavaMail which is missing. My application asks Guice "can you inject MultiPartReader?" and it replies with NoClassDefFoundError which is a bit unexpected. I am somewhat expecting it to answer "no, and here's why" not throw an exception that indicates the checking process itself failed.
Gili On Jan 6, 12:08 pm, Gili <[email protected]> wrote: > Hi, > > I just noticed that injector.getBinding(Key) throws > ClassDefNotFoundError which is unexpected. Here is the stack-trace: > > java.lang.NoClassDefFoundError: javax/mail/MessagingException > at java.lang.Class.getDeclaredConstructors0(Native Method) > at java.lang.Class.privateGetDeclaredConstructors(Class.java: > 2389) > at java.lang.Class.getDeclaredConstructors(Class.java:1836) > at com.google.inject.spi.InjectionPoint.forConstructorOf > (InjectionPoint.java:192) > at com.google.inject.ConstructorInjector.<init> > (ConstructorInjector.java:47) > at com.google.inject.InjectorImpl$5.create(InjectorImpl.java: > 753) > at com.google.inject.InjectorImpl$5.create(InjectorImpl.java: > 749) > at com.google.inject.internal.FailableCache$1.create > (FailableCache.java:32) > at com.google.inject.internal.ReferenceCache.create > (ReferenceCache.java:54) > at > com.google.inject.internal.AbstractReferenceCache.internalCreate > (AbstractReferenceCache.java:59) > at com.google.inject.internal.AbstractReferenceCache.get > (AbstractReferenceCache.java:116) > at com.google.inject.internal.ReferenceCache.get > (ReferenceCache.java:28) > at com.google.inject.internal.FailableCache.get > (FailableCache.java:43) > at com.google.inject.InjectorImpl$LateBoundConstructor.bind > (InjectorImpl.java:457) > at com.google.inject.ClassBindingImpl.initialize > (ClassBindingImpl.java:52) > at com.google.inject.InjectorImpl.initializeBinding > (InjectorImpl.java:347) > at com.google.inject.InjectorImpl.createJustInTimeBinding > (InjectorImpl.java:639) > at > com.google.inject.InjectorImpl.createJustInTimeBindingRecursive > (InjectorImpl.java:584) > at com.google.inject.InjectorImpl.getJustInTimeBinding > (InjectorImpl.java:179) > at com.google.inject.InjectorImpl.getBindingOrThrow > (InjectorImpl.java:139) > at com.google.inject.InjectorImpl.getBinding(InjectorImpl.java: > 116) > at com.google.inject.InjectorImpl.getBinding(InjectorImpl.java: > 71) > > I just wanted to run this by you. Is this the best we can do or do we > want to wrap this in ConfigurationException or something? I understand > this is tricky given the fact that an Error is being thrown. > > Gili --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-guice?hl=en -~----------~----~----~----~------~----~------~--~---
