logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: NullPointerException in org.apache.log4j.NDC.get
Date Mon, 10 Jul 2006 21:03:14 GMT

On Jul 10, 2006, at 2:58 PM, Giesen Giesen wrote:

> I'm using 1.2.11, but in my Internet searching, I've seen someone else
> getting the exact same error in 1.2.13 (google: NullPointerException
> org.apache.log4j.NDC.get). I will upgrade my app.

Looks like several other people have run into the problem and have  
never taken the effort to identify the underlying problem (whether ht  
== null or Thread.getCurrentThread() == null) and report a bug  
against it.  It would be pretty simple to put a guard around the  
access to the Hashtable.get() call to avoid the NPE, but it would be  
nice to know how things are getting into the state where they are  
needed.

>
> Why would Thread.getCurrentThread() return null? Shouldn't that always
> return a non-null value?

The original authors of that section of code assumed that  
Thread.getCurrentThread() would always be non-null.

>
> Thanks for the response and suggestions! I'm hoping that it will
> happenly rarely enough to be overlooked until someone else identifies
> the issue and develops a good patch. Or until 1.3 is officially
> released.

Any investigation you can make into the particulars of the failure  
would be appreciated.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message