> -----Original Message-----
> From: Ola Berg [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 12, 2002 3:52 AM
> To: Tomcat Users List
> Subject: [classloading] How to use URLClassLoader within a servlet
> 
> 
> I have this problem with using my own (URLClassLoader) class 
> loader in a servlet of mine.
> 
> The thing is that I am writing a web front end to domain name 
> services (automatic registration of .org, .com. .biz, .info 
> etc domains).
> 
> Depending on the top level domain, I need to use different 
> versions (jars) of the same API, since the protocol differs. 
> So I need to dynamically load my classes at runtime. Just 
> putting the jars in lib won't work since there are different 
> implementations of the same classes in them. I have to decide 
> in runtime.
> 

couldn't you use this the 'top level domain' to determine which context to
send the request to?. This way each context will have its own version of the
library(in its own classloader) and you won't have the conflict. You will
have to copy any supporting library to each webapp also, but that's nowhere
near the problem you have now.

Charlie


> Using the URLClassLoader in a standalone app works perfectly, 
> when using it in a servlet it just hangs. I suspect the 
> problem lies within the different lookup order used in 
> servlets (as dscribed in the classloader-HOWTO). 
> 
> I can't figure out how to do it. 
> 
> Has anyone experience in the field?
> 
> /O
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to