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.
Update a running application Press Ctrl+F10 . From the main menu, select Run | Debugging Actions | Update application. Click.
To run the configuration, press Alt+Shift+F10 and select the created application server configuration. or press Shift+F10 to run it. You can also use the Services tool window to list and manage all available application server running configurations.
Press Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment | Application Servers. and select the application server.
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.
Update resources. All changed resources (that is, all application components other than the classes) will be updated.
Update classes and resources. All changed resources will be updated; changed classes will be recompiled. In the debug mode, the updated classes will be hot-swapped. In the run mode, IntelliJ IDEA will just update the changed classes in the output folder. Whether such classes will actually be reloaded in the running application, depends on the capabilities of the runtime being used.
Redeploy. The application will be updated and redeployed.
Restart server. The server will be restarted. The updated version of the application will be deployed at the server startup. For packed artifacts, the available options are:
Hot swap classes. Changed classes will be recompiled and reloaded at runtime. Note that this option will work only in the debug mode. Redeploy. The overall application will be rebuilt and redeployed. Restart server. The server will be restarted. The application will be rebuilt and deployed at the server startup.
From: http://www.jetbrains.com/idea/webhelp/run-debug-configuration-tomcat.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With