[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH]: ClassLoader problem in Servlet environment (Tomcat)



On Sun, 11 Mar 2001, Nathan Eric Probst wrote:
> Falko, thank you for your detailed and to-the-point response.  I must admit, I am still
> learning tons every day about the intricacies of Java (and esp. ClassLoaders)!  After
> re-reading you message a few times and reading a few other resources on ClassLoaders, I
> realized that - with your patch - all I needed to do was call
>       Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
> in each servlet, before the first access to ExternalDatabase or LocalDatabase.  This
> approach seems to work with both.
I guess not all servlet engines will allow to setClontextClassLoader() but if
it works in your environment, then it's ok.

 > 
> Thanks for your patience with me,
> Nathan Probst
> 
> P.S.  What is the purpose for having a specialized OzoneClassLoader?  If you could explain
> it to me, I feel that I now posess sufficient understanding of ClassLoaders to attempt a
> solution.

OzoneClassLoader would be needed to implement some nifty and cool things like:

- build proxies on-the-fly when they are needed

- directly load proxies and/or database classes from the server into the client
to avoid inconsistency problems

and maybe some others.

Current version of OzoneClassLoader more or less does the same as
URLClassLoader. Therefore it was no problem to simply don't use it for now.


Falko
-- 
______________________________________________________________________
Falko Braeutigam                              mailto:falko@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com