ant-user mailing list archives

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

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!

Dave

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


Mime
View raw message