avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject Re: Logkit: NullPointerException in JMSQueueTarget constructor
Date Wed, 27 Feb 2002 08:41:56 GMT
On Wed, 27 Feb 2002 18:24, david.gray@hic.gov.au wrote:
> I think that it fails in createQueueConnection(), the code catches the
> exception runs getErrorHandler()  which then throws the NPE because the
> error handler is not defined!

doh!

> If you track through the code, the private variable ErrorHandler
> m_errorHandler in AbstractTarget is never initialized.

It is initialized as soon as the target is associated with a 
Hierarchy/Logger. See something like Logger.setupErrorHandlers()

> I suspect the only way to resolve this sort of problem is to initialize the
> field thus:
>
>     private ErrorHandler m_errorHandler = new
> org.apache.log.util.DefaultErrorHandler();
>
> Has anyone else seen this problem?

not in that case - I guess we really need to think of a good way to do this. 
Ideally open() should not be called until after it is attached to a Logger 
hierarchy but that is not really elegant. 

Maybe we could create a dummy error handler until it has been attached to 
Logger ?

Anyone got any better ideas?

-- 
Cheers,

Pete

---------------------------------------------------------------
The difference between genius, and stupidity? Genius has limits
---------------------------------------------------------------

--
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