Reputation: 669
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
Reputation: 63
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
Reputation: 1955
Two more things to check:
Upvotes: 3
Reputation: 29276
To make Eclipse Tomcat update automatically or hot deploy you have to make certain changes in server configuration:
Below are the steps:
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.
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.
Start Project in DEBUG
mode. Hot Deploy is supported in DEBUG mode only.
Upvotes: 12