km369
km369

Reputation: 26

How to redeploy one class of webapp running on tomcat?

I made a change in my web application on just one class. It is very tiny bugfix. My web application is based on jsf and dci and it's deployed inside Tomcat 7. Is there any fast way I could just apply that change on my production server or I have to undeploy old war and deploy new war with bugfix inside?

Upvotes: 0

Views: 222

Answers (2)

Christopher Schultz
Christopher Schultz

Reputation: 20837

Whether you do it yourself or Tomcat does it for you (auto-redeploy), you must restart the entire web application.

Tomcat can't tell if your class is in use by objects already in memory, etc. so it has to load a completely new ClassLoader and re-start your application to keep it in a sane state.

So the short answer to your question is "no, there is no fast way."

Upvotes: 0

Trevor Freeman
Trevor Freeman

Reputation: 7232

You can put a modified class file in the appropriate folder to override the war (or replace the class file if you are using an exploded war), and then restart Tomcat to ensure it is picked up.

However, if this is a production server as you state then I would never do this, and would do a full deploy from a tested war file.

Upvotes: 1

Related Questions