Sunday, April 5, 2009

How to avoid WTP restart Tomcat after code hotswap

This is not really a topic about frameworks rather than a tip while developing in Eclipse WTP. Since the time of Sysdeo Tomcat plugin, Java developers knew that one could change code on the fly and have the code hot-swapped, without having to restart the Tomcat. In the time of WTP, this is not longer true by default but you can re-enable this feature as follows:

Open Server Tab -> Select your app server and right click "Open" -> Publishing, and choose "Never publish automatically"

We have to do this since the default context.xml that WTP generates forces context reload whenever it detecs changes in WEB-INF/classes. You can check out the server.xml at:

\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\server.xml

Where you will see reloadable="false" now
reloadable="false" source="org.eclipse.jst.j2ee.server:sample"/>


No comments: