Re: URLLoader / RemoteURLLoader

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

 



Well I am actually patching URLClassLoader. RemoteURLLoader seemed to provide some connection to http protocol. When is it exactly used? I tried to manually add an http URL (jar:/http://www.mywebsite/myjar.jar) in URLClassLoader constructor (using addURL method), and indeed it tries to use RemoteURLLoader.

although this doesn't work, for some reason it throws
java.lang.NoClassDefFoundError: Test
   <<No stacktrace available>>
Caused by: java.lang.NoClassDefFoundError: gnu/java/net/protocol/http/Headers
   at gnu.java.net.protocol.http.HTTPURLConnection.<init>(HTTPURLConnection.java:101)
   at gnu.java.net.protocol.http.Handler.openConnection(Handler.java:69)
   at java.net.URL.openConnection(URL.java:723)
   at gnu.java.net.protocol.jar.Connection$JarFileCache.get(Connection.java:102)
   at gnu.java.net.protocol.jar.Connection.connect(Connection.java:140)
   at gnu.java.net.protocol.jar.Connection.getInputStream( Connection.java:158)
   at gnu.java.net.loader.RemoteURLLoader.getResource(RemoteURLLoader.java:80)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:532)
   at java.lang.ClassLoader.loadClass(ClassLoader.java :380)
   at java.lang.ClassLoader$1.loadClass(ClassLoader.java:1150)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:332)

Is this sci-fi to work inside URLClasseLoader to load classes from http URL ?

Regards,
Martin

2007/5/29, Tom Tromey <tromey@xxxxxxxxxx>:
>>>>> "Martin" == Martin Schlienger <m.schlienger@xxxxxxxxx> writes:

Martin> -I noticed that URLLoader and RemoteURLLoader are also
Martin> intended to load remote directories. May someone give me any
Martin> hint to use these one?

These are only for use as internal helpers of URLClassLoader.

Martin> The very best would be that we launch our software with jamvm
Martin> -classpath http: //url-to-my-classpath-classes/mypackage.jar

You may want to look at JNLP.

Martin> Another question: what is the gnu/java/net/loader/Load_ prefix
Martin> for? there is no class that begins with Load_ .

This is in cases a VM wants to add support for some URL type it
provides.  libgcj uses this to handle gcjlib: URLs.

Tom


[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux