On Thu, 12 Dec 2002, Ola Berg wrote:

> Date: Thu, 12 Dec 2002 12:19:35 +0100
> From: Ola Berg <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: [classloading] How to use URLClassLoader within a servlet
>
> >Or you could try to isolate the problem with an example and post
> >that to the list.
>
> The problem can be stated as
>
> ---8<---
>
> URL[] urls = new URL[]{ new URL("http://www.myserver.com/jars/myapi-1.2.jar";) };
> URLClassLoader cl = new URLClassLoader( urls); //have tried different parents
>
> //here it hangs
> Class c = cl.loadClass( "nu.viggo.my.MyClass");
>
> --->8---
>
> Above snippet works in standalone app, but not in servlet.
>
> Tested with several kinds of URLs (class file directories, jarfiles, http, ftp) same 
>result.
>
> Any clues? Craig? Anyone?
>
> /O
>

When I battle with class loaders, I usually lose too :-).

However, If you want to use a remote JAR file in a class loader, shouldn't
the syntax of your URL match that defined in the Javadocs for
JarURLConnection?

Craig


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

Reply via email to