Forums Register Login

Reload a modified java class

+Pie Number of slices to send: Send
Hi,

I was doing some byte code injection with asm. I tried to inject some code to the class file. But it is found that if I tried to find the injected code, it is not available within the already loaded class. So a clean restart of JVM is required to find the injected code within the object.
So I was wondering how can I reload a class without restarting the JVM ?
+Pie Number of slices to send: Send
Byte code injection and class loading aren't really beginning topics, so I'm going to move this thread.
+Pie Number of slices to send: Send
Thanks Paul.

Once again I am answering to my own question.

In order to achieve what I mentioned, one needs to extend ClassLoader and try to reload the classes when ever required.

I got the answer from here


webpage
What are you saying? I thought you said that Santa gave you that. And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1101 times.
Similar Threads
use of JavaBean in JSP
[Struts 2] execute not called - strange error message
unload class from JVM
How to unload a class/jar from the classpath under Weblogic environment
nonintrusive in spring
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 06:15:43.