logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Niski <joeni...@yahoo.com>
Subject Re: AW: NullPointerException from MDC in IBM WSAD 5.1/WebSphere 5.0.2
Date Wed, 04 Feb 2004 18:27:28 GMT
Thanks for the reply, Gyoergy.

For debugging, i simply pointed WSAD's debugger at the
source files - this allows me to step through, set
breakpoints, etc.

The ThreadLocalMap named tlm gets initialized in MDC's
constructor, and according to the debugger is not
null. Actually, in the debugger it looks the same as
when i'm running in a server that allows the code to
succeed.

thanks again,

Joe
--- gyoergy.magoss@bhf.ing.com wrote:
> Hi,
> 
> if 
> Hashtable ht = (Hashtable)
> ((ThreadLocalMap)tlm).get();
> throws a NPE from my point of view tlm is null.
> Since you traced the code and most probably (as I
> guess from the names of the variables) did a
> decompile of the class (using jad, i guess), you
> should find a point in the code prior to that call
> where tlm is set to something.
> Look for that part that is where you will find the
> cause of your problem, I think.
> 
> Regards
> 
> Gyoergy 
> 
> -----Ursprüngliche Nachricht-----
> Von: joeniski@yahoo.com [mailto:joeniski@yahoo.com] 
> Gesendet: Mittwoch, 4. Februar 2004 01:40
> An: log4j-user@logging.apache.org
> Betreff: NullPointerException from MDC in IBM WSAD
> 5.1/WebSphere 5.0.2
> 
> 
> From: joeniski@yahoo.com
> To: log4j-user@logging.apache.org
> Date: Tue, 3 Feb 2004 16:40:10 -0800
> Subject: NullPointerException from MDC in IBM WSAD
> 5.1/WebSphere 5.0.2
> 
> Greetings:
> 
> I'm using IBM's WSAD 5 and the embedded Websphere 5
> runtime environment. The web project in my
> enterprise
> app contains a servlet that uses the DOMConfigurator
> to configure Log4j and then log a message that
> configuration succeeded. The log4j.jar (version
> 1.2.8)
> is in WEB-INF/lib.
> 
> My ConversionPattern for the PatternLayout class
> contains this pattern:
> 
> [USERID]%X{USERID}[MESG]%m
> 
> In WSAD 5.0.1 with Websphere 5.0.0 s0245.03, the
> code
> runs fine. Since my servlet code doesn't set a
> "USERID" in the MDC, the output looks like this:
> 
> [USERID][MESG]Initialization successful.
> 
> However, in WSAD 5.1 (with all the latest fixpacks)
> and its Websphere 5 runtime (version  5.0.2
> ptf2M0325.01), the attempt to log a message throws a
> NullPointerException. i've traced the NPE to line
> 118
> in the MDC code:
> 
> Hashtable ht = (Hashtable)
> ((ThreadLocalMap)tlm).get();
> 
> The call to get() throws the NPE in WSAD 5.1. In
> WSAD
> 5.0.x, this line executes and the following line
> returns a null (as it should). It also works this
> way
> in WSAD 5.1 using the embedded Websphere 4 runtime.
> In
> searching BugZilla, i found bug # 10528, fixed in
> July
> 2002, which modified the code on MDC line 119 - it's
> close to my problem! but trouble happens on line
> 118.
> 
> Does anyone have an idea of why this might be
> happening? i searched IBM's Websphere support with
> no
> luck, and am trying to examine what's going on in
> the
> classloaders to see how that might be different
> between WSAD/Websphere versions. i vaguely suspect a
> security problem, but it's unclear why that would
> cause an NPE.
> 
> thanks in advance,
> Joe
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free web site building tool.
> Try it!
> http://webhosting.yahoo.com/ps/sb/
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail:
log4j-user-help@logging.apache.org


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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