Tomcat Hot Deplot 适用于 JSP 文件但不适用于 Java 文件

标签 tomcat tomcat6

由于我 PC 的性能问题,我没有使用 Eclipse-Tomcat-Maven 集成的标准路线。我所做的是使用 Maven 构建我的更改,然后手动将文件复制到 Tomcat webapps 文件夹。

每当我将 JSP 文件复制到 webapps 文件夹时,我都可以看到更改已反射(reflect)出来。但是,对于类文件,根本不会反射(reflect)更改。

我只是在我的类的方法中做一些小的改变(添加一个系统输出,或删除一行代码等),而不是做任何结构上的改变。

在我的 server.xml 中,我可以看到 autodeploy 和 deployonstartup 设置为 true。

 <Engine defaultHost="localhost" name="Catalina" jvmRoute="tomcat01" debug="0">
 <Host appBase="webapps" name="localhost" autoDeploy="true" 
     deployOnStartup="true" unpackWARs="true" deployXML="true">

Tomcat版本为Apache Tomcat/6.0.29

谁能告诉我哪里出了问题?

最佳答案

正在读取 tomcat6 documentationDeploying on a running Tomcat server 部分,它在最后一行声明:

Note that web application reloading can also be configured in the loader, in which case loaded classes will be tracked for changes.

因此去装载机documentation您可以看到设置加载器配置的属性 reloadable 将完全按照您的要求执行

reloadable: Set to true if you want Catalina to monitor classes in /WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically reload the web application if a change is detected. This feature is very useful during application development, but it requires significant runtime overhead and is not recommended for use on deployed production applications. You can use the Manager web application, however, to trigger reloads of deployed applications on demand. NOTE - The value for this property will be inherited from the reloadable attribute you set on the surrounding Context component, and any value you explicitly set here will be replaced.

关于Tomcat Hot Deplot 适用于 JSP 文件但不适用于 Java 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17802440/

相关文章:

android - spring MVC中下载多张图片的Web服务

java - 如何解决我的 Jsp 程序中的错误?

java - Tomcat 中 tomcat-juli.jar 的多个实例

java - 如何使用 java 和 tomcat 在本地将 war 作为 Web 服务运行?

java - 为了邮寄需要重启服务器

tomcat - 无法通过 .ebextensions 文件更改 AWS 中的 tomcat 配置

java - 从 Http 响应读取数据很少引发 BindException : Address already in use

tomcat - 将应用程序从 websphere 迁移到 tomcat

java - Tomcat 7.0.29 servlet-api 类加载器问题

eclipse - 配置 eclipse 以与 tomcat 一起工作