Mauro M
Mauro M

Reputation: 669

Eclipse Tomcat not Updating

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:

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

Upvotes: 14

Views: 28036

Answers (3)

I had roughly the same problem and after tried it all with no success I gave up, created another fresh workspace and the problem was gone. Not the ideal solution but hey, it's an option.

Upvotes: 0

boly38
boly38

Reputation: 1955

Two more things to check:

  • deploy directory: in the tomcat server UI and according to "deploy path" configuration, check that the output directory has read/write access (you could also remove it and try to publish again : check expected output resources/classes).
  • deployment assembly: in project properties menu; in the "deployment assembly" section, check that you are publishing all wanted resources. For example, in my case I download/generate some items from maven custom plugin phase and this resources are not published by default. I had to add some target subdirectories here...

Upvotes: 3

Arpit Aggarwal
Arpit Aggarwal

Reputation: 29276

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.

Upvotes: 12

Related Questions