I've been looking into this some more and I believe the source of this issue is 
due to some rogue threads in my app that are trying to use instances of 
components that have already been destroyed (as far as the Tuscany runtime is 
concerned).  So, based on what I've been seeing, I believe this is a problem in 
my app and not an issue w/ Tuscany.

-----Original Message-----
From: Simon Nash [mailto:[email protected]] 
Sent: Saturday, September 26, 2009 02:14
To: [email protected]
Subject: Re: UndeclaredThrowableException when using reference

Simon Laws wrote:
> Looking at the stack it looks like a Java implementation. But you're
> right that there is a suspicious piece of code in
> AbstractScopeContainer..
> 
>     protected InstanceWrapper createInstanceWrapper() throws
> TargetResolutionException {
>         ImplementationProvider implementationProvider =
> component.getImplementationProvider();
>         if (implementationProvider instanceof ScopedImplementationProvider) {
>             return
> ((ScopedImplementationProvider)implementationProvider).createInstanceWrapper();
>         }
>         return null;
>     }
> 
> 
> Where, in the case of the CompositeScopeContainer, the null is not checked 
> for.
> 
> Simon
> 
> 
I agree that this code looks suspicious.  However, the null won't
be returned unless implementationProvider is not an instance of
ScopedImplementationProvider.  JavaImplementationProvider does
implement the ScopedImplementationProvider interface, so this code
should not return null but should call createInstanceWrapper().
 From a quick look at the createInstanceWrapper() code, this call
should always return non-null.

   Simon

Reply via email to