简体   繁体   English

Eclipse上的tomcat服务器:如何随意使tomcat服务器重新加载项目上下文

[英]tomcat server on Eclipse : how to make tomcat server reload project context at will

I am writing a simple restful APT on Eclipse neon 3 and tomcat 7 (tomcat 9 does not work either). 我在Eclipse neon 3和tomcat 7上编写了一个简单的静态APT(tomcat 9也不起作用)。 But Tomcat server could not update after I save my java code and run my project on the server. 但是保存我的Java代码并在服务器上运行项目后,Tomcat服务器无法更新。 I noticed that only when the server reload the context like below, it executed the updated version of java files: 我注意到只有当服务器重新加载如下所示的上下文时,它才会执行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

The problem is how to make tomcat server reload project context at will so that I can reload the context whenever I want. 问题是如何随意使tomcat服务器重新加载项目上下文,以便我可以随时重新加载上下文。

I have tried the following options, but all failed: 我尝试了以下选项,但都失败了:

1) build project + run on sever 1)构建项目+在服务器上运行

2) restart server 2)重启服务器

3) restart server on debug mood. 3)在调试状态下重新启动服务器。

Also, tomcat server.xml reloadable property in Context is true be default. 另外,默认情况下,上下文中的tomcat server.xml reloadable属性为true。

Thanks a lot! 非常感谢!

Check your eclipse properties. 检查您的日食属性。 Go to your project properties --> check deployment assembly and java build path. 转到项目属性->检查部署程序集和Java构建路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM