tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cox, Charlie" <c...@cincom.com>
Subject RE: [classloading] How to use URLClassLoader within a servlet
Date Thu, 12 Dec 2002 13:56:00 GMT


> -----Original Message-----
> From: Ola Berg [mailto:ola.berg@ports.se]
> 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:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:tomcat-user-help@jakarta.apache.org>
> 

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


Mime
View raw message