Eclipse Tomcat not Updating

Mauro M picture Mauro M · Jul 6, 2015 · Viewed 22.4k times · Source

I am developing an application with SpringMVC and Tomcat using Eclipse. The problem is: the server does not update the changes I am making.

One example:

@RequestMapping(value = "test", method = RequestMethod.GET)
    public ModelAndView test(){

        ModelAndView mv = new ModelAndView("test");                 
        System.out.println("test");
        return mv;
    }

Every time I hit the mapped url, Eclipse prints test in my console. If I comment out the println, I get the same result.

Attempts to fix the problem:

  • clean Tomcat directory
  • restart the server
  • close Eclipse
  • add/remove the project in the Server tab
  • delete the JSP the method is using
  • different browsers

All to no effect. It just looks like Tomcat is not updating any changes I make in the code.

Answer

Arpit Aggarwal picture Arpit Aggarwal · Jul 6, 2015

To make Eclipse Tomcat update automatically or hot deploy you have to make certain changes in server configuration:

Below are the steps:

  1. Double clicks on the Tomcat Server, refer to "publishing" tab in the "Overview" view, make sure "Automatically publish when resources change" is selected. This should be the default option, to support “hot deploy” resources, for example : JSP, XML and properties files.

  2. In the Tomcat Plugin page, click on the "Modules" view, Select the Module then click on Edit button and make sure "Auto Reload" is "Disabled". Default is enabled.

  3. Start Project in DEBUG mode. Hot Deploy is supported in DEBUG mode only.