avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Sutic" <leo.su...@inspireinfrastructure.com>
Subject RE: [Bug?]: ExcaliburComponentManager ignoring Exceptions
Date Tue, 23 Apr 2002 08:33:09 GMT


> From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de]
>
> Hi,
>
> it just took me days to find a problem in my application, because of
> this code in lookup method of the ExcaliburComponentManager:
>
>             if( m_parentManager != null )
>             {
>                 try
>                 {
>                     return m_parentManager.lookup( role );
>                 }
>                 catch( Exception e )
>                 {
>                     // ignore.  If the exception is thrown, we try to
>                     // create the component next
>                 }
>             }
>
> If I have a hierarchy of CMs and an exception occurs in the parent
> CM this is silently ignored and later on in the lookup method an
> exception with the message "component not found" is generated.
>
> If I have a bug in my component which is correctly found by the
> parent CM but unfortunately throws a NPE in the compose() method,
> I will never get aware of this.
>
> Why isn't the exception rethrown? Can we change this?

Maybe the intent was:

             if( m_parentManager != null )
             {
                 try
                 {
                     return m_parentManager.lookup( role );
                 }
                 catch( ComponentException e ) << Only catch
ComponentExceptions, not RuntimeE*
                 {
                     // ignore.  If the exception is thrown, we try to
                     // create the component next
                 }
             }

Anyone else?

/LS


--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message