skip to Main Content

Whenever I make any changes in java file, I have to restart server again and again for even small changes it. changes do not publish to server.

It is really time taken process.
how can I apply those changes in server without restarting server ?

I tried to auto publish while saving, but still it does not work.

2

Answers


  1. I think the most simple way to do this is to let your eclipse write the class files directly to the tomcat webapp class folder (i.e. $TOMCAT/webapps/YOUR_WEB_APPLICATION/WEB_INF/classes). Then, allow tomcat to check if the class files have been updated, and reload them if they have.

    • To allow tomcat auto-reload class when classes are changes, please update

    $TOMCAT_HOME/conf/context.xml

    <Context reloadable="true"> 
    
    • There is on more thing you need to update in your web application to
      allow reload. in your application web.xml file and add <web-app reloadable="true">.
    Login or Signup to reply.
  2. Ideally for changes to get reflected you will have to restart the server. The only way to get it done is to replace the specific class file by compiling the class, and manually replacing the class inside the war (assuming you have a Tomcat).

    In usual cases the above process will take almost the same time as deploying a new war/ear and having the server restarted.

    PS: I would not personally recommend the above solution, since it’s a hack and you may run into multiple problems when you do an actual build.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search