What is the difference between "Redeploy" and "Restart Server" in IntelliJ?

noisebelt picture noisebelt · Dec 18, 2012 · Viewed 7.8k times · Source

I'm using IntelliJ with Tomcat 6 to run a Spring Java EE application. Rather than deploying the compiled war, I have opted to use the exploded war deployment, thus giving me the option to hotswap some classes and JSPs.

However, aside from the "Update Classes" and "Update Classes and Resources", IntelliJ also allows users to "Redeploy" and "Restart Server" on an update action. What is the difference between these two choices?

If I make a change to my method signatures in my class, or if I make a change in my Springconfig.xml, do I need to restart the server, or is a redeploy sufficient? I've noticed that I am unable to simply hotswap classes whose function signatures or annotations associated with them have been modified.

Answer

RoryB picture RoryB · Dec 18, 2012

Restart server does exactly what it says, and restarts the tomcat server. Your war will be rebuilt and deployed at server startup. This is useful if you are having trouble hot-swapping your classes.

Redeploy will redeploy the entire .war (without restarting the server), as opposed to trying to hot-swap out changed classes and other resources.

See also: http://www.jetbrains.com/idea/webhelp/updating-a-running-java-ee-application.html

In answer to your second question, a redeploy should be sufficient. That said, it can cause memory leaks and is often only slightly faster than a full restart.