xiaodududu / google-guice

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

NullPointerException at com.google.inject.internal.Initializer$InjectableReference.get(Initializer.java:147) #735

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is likely related to issue #627 (and possibly #473).

I have just reproduced this NPE in our large and complex production 
application, running Guice 3.0. Moreover, I came across a small 
test-configuration that exhibits the same exception:

https://groups.google.com/forum/#!msg/roboguice/3LW0xMEr2hI/B2Rgk9L1_kgJ

(I've attached the test-source to this report for durability/convenience.)

I can't be certain that the circumstances are exactly the same as our 
real-world app, but we do use all of the features invoked by this sample 
together.

In our case, the exception is intermittent: it only throws about 70% of the 
time.

Original issue reported on code.google.com by joshgr@gmail.com on 13 Nov 2012 at 8:21

Attachments:

GoogleCodeExporter commented 9 years ago
Here's the full stack-dump:

1 error
    at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:435)
    at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:175)
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:109)
    at com.google.inject.Guice.createInjector(Guice.java:95)
    at com.google.inject.Guice.createInjector(Guice.java:72)
    at com.google.inject.Guice.createInjector(Guice.java:62)
    at GuiceTest.main(GuiceTest.java:14)
    ... 6 more
Caused by: java.lang.NullPointerException
    at com.google.inject.internal.Initializer$InjectableReference.get(Initializer.java:147)
    at com.google.inject.internal.ConstantFactory.get(ConstantFactory.java:35)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.Scopes$1$1.get(Scopes.java:65)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
    at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
    at com.google.inject.internal.InjectionRequestProcessor$StaticInjection$1.call(InjectionRequestProcessor.java:116)
    at com.google.inject.internal.InjectionRequestProcessor$StaticInjection$1.call(InjectionRequestProcessor.java:110)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
    at com.google.inject.internal.InjectionRequestProcessor$StaticInjection.injectMembers(InjectionRequestProcessor.java:110)
    at com.google.inject.internal.InjectionRequestProcessor.injectMembers(InjectionRequestProcessor.java:78)
    at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:170)
    ... 11 more

Original comment by joshgr@gmail.com on 13 Nov 2012 at 8:29

GoogleCodeExporter commented 9 years ago

Original comment by sberlin on 13 Nov 2012 at 8:29