ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Herman, Dave" <>
Subject RE: ClassLoader: log4j 1.2 in JUnit tests
Date Sat, 19 Jan 2002 00:04:00 GMT

Thank you very much for your response.

> Thread.currentThread ().setContextClassLoader 
> (getClass().getClassLoader 
> ());

I tried this but got linkage errors. I'll have to play around with it some
more but I don't think it will work.

> >The log4j FAQ says that they're using the Java 2 "preferred 
> method for
> >loading classes" now:
> >
> >Thread.currentThread().getContextClassLoader().loadClass()
> This statement is quite wrong. Thread context loaders were 
> introduced to 
> make standard extensions like JNDI work [in JDK 1.2.x], where 
> that was the 
> only possible solution. In general, business code should 
> continue to use 
> the current classloader (getClass().getClassLoader()).

This makes me think that perhaps the log4j behavior (which is new in log4j
1.2) might be incorrect. I've posted to the log4j mailing list as well.

Thanks again!


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message