【发布时间】:2018-02-13 04:43:49
【问题描述】:
我正在 Eclipse neon 3 和 tomcat 7 上编写一个简单的 restful APT(tomcat 9 也不工作)。但是在我保存我的 java 代码并在服务器上运行我的项目后,Tomcat 服务器无法更新。我注意到只有当服务器像下面这样重新加载上下文时,它才会执行更新版本的 java 文件:
Sep 04, 2017 8:20:35 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/messenger] has started
Sep 04, 2017 8:20:37 PM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Sep 04, 2017 8:20:38 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/messenger] is completed
问题是如何让tomcat服务器随意重新加载项目上下文,以便我可以随时重新加载上下文。
我尝试了以下选项,但都失败了:
1) 构建项目+在服务器上运行
2) 重启服务器
3) 在调试状态下重启服务器。
另外,在 Context 中的 tomcat server.xml reloadable 属性默认为 true。
非常感谢!
【问题讨论】: