Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic re-loading of class files

 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,

I would liked to know is it possible to achieve dynamic reloading of class files without re-starting the server.

I believe hot deployment is the ability to deploy the application (new or existing) while the server is running. But i
would liked to load the changes to the class files without restarting the server.

We use a whole lot of EJB's in our application, which makes the restarting process around 8 min.

So i would liked to know is it possible to load the class files dynamically without re-starting the server.

Thanks
Param
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are your classes packaged and deployed? With an EAR file? Or within an exploded EAR directory? If you have an EAR file, replacing it with an updated version will redeploy it. If you have an exploded directory, 'touch' the META-INF/application.xml file - this will cause the app to be redeployed.
 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter,
We use Ant to move the files to the deploy directory and use touch task to re-start the server, to pick the new files.


But i would liked to know is there anyway we can make the app to pick the new class file without re-starting (through touch task) the application.

The main purpose of why i am looking forward is, restarting the app takes 8 mins.
Since we have lot of EJB's it takes some time to undeploy and re-deploy the EJB's.
And also EJB's are not changed frequently. But we work at the web layer (servlet or Action class). So i would want to know is there any way we can load the latest class file without re-starting the server.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A related topic
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic