posted 21 years ago
Hi, I want to hot-swap the implementation of a class which is packed in a jar-file.
for example:
Later I want to swap the implementation by providing a new jar-file.
This doesn't work. The new class gets never loaded.
I thought, that I have to write my own classloader to change the order of searching for classes in the method .
Everytime I try to call , I get the following exception:
java.lang.ClassNotFoundException: com.test.compA.ServiceAImpl
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at com.test.OwnClassLoader.loadClass(OwnClassLoader.java:43)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.test.ComponentManager.loadComponent(ComponentManager.java:176)
at myTest.MyTest.main(MyTest.java:12)
Caused by: java.util.zip.ZipException: invalid block type
at java.util.zip.InflaterInputStream.read(Unknown Source)
at sun.misc.Resource.getBytes(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
The ZipException does occur, when i call the method .
Any ideas? Thx in advance...
Chris