Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reload a modified java class

 
Manu Somasekhar
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Byte code injection and class loading aren't really beginning topics, so I'm going to move this thread.
 
Manu Somasekhar
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic