Replacing Base Class Loader

Hi All,

I'm using SOAP to transfer Java Objects to my application. Everything works great if the client has access to the class file for the object it receives.

I get a ClassNotFoundException in my deserializer if the class file is not available on the client.

I can solve this problem (I think) if I can replace the base class loader with mine. Does anyone know how this can be done?

Thanks.

[438 byte] By [WynEaston] at [2007-9-26 2:33:38]
# 1
I don't think there's any way to replace the system classLoader, but I think you can augment it during application initialization with a custom classLoader. See this JavaWorld article. http://www.javaworld.com/javaworld/jw-03-2000/jw-03-classload.html
walpj at 2007-6-29 9:57:02 > top of Java-index,Desktop,Runtime Environment...
# 2

Thanks for the reply. I think I've got a much better idea of how this stuff works now. I think what I need to do is register my deserializer with SOAP as a class that will really load the deserializer using Class.forName() with my class loader as a parameter. Then when the bootstrap class loader can't find a class, findClass() in my classloader will be called and I can load it from a URL.

Should work.

Thanks very much!

WynEaston at 2007-6-29 9:57:02 > top of Java-index,Desktop,Runtime Environment...