bineanzhou / google-guice

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

NullPointerException during Provider.get() call in an proxied instance #190

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Regarding
http://groups.google.com/group/google-guice/browse_thread/thread/fd1c65570f0f07c
a

I have created a scope, that wraps another scope and returns a provider,
which itself returns a proxy instead of a instance. When calling the proxy
(which wraps all calls to the original instance via MethodInterceptor) the
proxy asks the wrapped scope for an instances and delegates the invocation
to the appropriate method of instance. The NullPointerException occurs when
the proxy tries to retrieve the instance from the wrapped scope.

Tested with Guice 1.0

Original issue reported on code.google.com by sven.lin...@gmail.com on 15 Apr 2008 at 4:42

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry, I forgot to attach the trace:

java.lang.NullPointerException
    at com.google.inject.InternalContext.getExpectedType(InternalContext.java:67)
    at com.google.inject.InjectorImpl$ImplicitBinding.get(InjectorImpl.java:1006)
    at com.google.inject.BindingBuilderImpl$FactoryProxy.get(BindingBuilderImpl.java:299)
    at
com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFact
oryAdapter.java:37)
    at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:747)
    at
com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactory
Adapter.java:35)
    at de.kamalook.guice.scope.ProxiedScopes$2$1$1.intercept(ProxiedScopes.java:94)
    at $java.util.ArrayList$$EnhancerByCGLIB$$7f2e38ff.add(<generated>)
    at de.kamalook.guice.scope.ProxiedScopeTest$DummyClass.add(ProxiedScopeTest.java:34)
    at de.kamalook.guice.scope.ProxiedScopeTest.usageInSingleton(ProxiedScopeTest.java:68)

Original comment by sven.lin...@gmail.com on 20 Apr 2008 at 9:29

GoogleCodeExporter commented 9 years ago
Duplicate of #136. 

Original comment by limpbizkit on 5 Jun 2008 at 6:50