Eclipse Tomcat does not update

I am developing an application with SpringMVC and Tomcat using Eclipse. The problem is that the server is not updating 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; } 

Each time I click on the display URL, Eclipse prints a test in my console. If I comment on println , I get the same result.

Attempts to fix the problem:

  • clear Tomcat directory
  • restart the server
  • close eclipse
  • add / remove a project on the Server tab
  • remove the jsp that uses the method
  • various browsers

All without effect. It just looks like Tomcat is not updating any changes made to the code.

+7
java spring eclipse tomcat hotdeploy
source share
2 answers

To make an Eclipse Tomcat update automatic or hot, you need to make certain changes to the server configuration:

Following are the steps:

  • Double-click on Tomcat Server , see the "publishing" tab in the "Overview" view, make sure that "Automatically publish when resources change" . This should be the default option to support "hot deploy" resources, for example: JSP, XML, and property files.

  • On the Tomcat Plugin page, click on the "Modules" view, select Module, and click Modify and make sure "Auto Reload" strong> "Disabled" . Enabled by default.

  • Run the project in DEBUG mode. Hot Deploy is only supported in DEBUG mode.

+6
source share

Two more things to check:

  • deployment directory : in the tomcat server user interface and in accordance with the “deployment path” configuration, make sure that the output directory has read / write access (you can also delete it and try to publish again: check the expected output resources / classes).
  • deployment layout : in the project properties menu; in the Install Installation section, make sure that you publish all the resources you need. For example, in my case, I load / generate some elements from the phases of the user maven plugin, and these resources are not published by default. I needed to add some target subdirectories here ...
+1
source share

All Articles