Tomcat 警告 : "Setting property ' showServerInfo' to 'false' did not find a matching property"

标签 tomcat

我正在尝试更改我的 Web 应用程序,以便它在生成错误时不提供有关服务器类型或版本的任何详细信息,如 this page 中所述.因此,在我的 webapp 的 META-INF/context.xml 文件中,我添加了一个 ErrorReportValve,如下所示:

  <Host name="localhost"  appBase="webapps"
        unpackWARs="true" autoDeploy="true"> 

   ...

    <Valve className="org.apache.catalina.valves.ErrorReportValve" 
        showReport="false" 
        showServerInfo="false" />

   ...

  </Host>

但是当我启动 tomcat 时,我收到此错误消息:

2015 年 2 月 27 日晚上 11:48:26 org.apache.tomcat.util.digester.SetPropertiesRule 开始 警告:[SetPropertiesRule]{Context/Valve} 将属性“showReport”设置为“false”未找到匹配的属性。

2015 年 2 月 27 日晚上 11:48:26 org.apache.tomcat.util.digester.SetPropertiesRule 开始 警告:[SetPropertiesRule]{Context/Valve} 将属性“showServerInfo”设置为“false”未找到匹配的属性。

(我在 Ubuntu 14.04.2 LTS 上运行 tomcat 7.0.52)

谁能提出为什么 ErrorReportValve 似乎缺少属性?

最佳答案

问题是我的 tomcat 版本太旧 - 直到 7.0.54 版才包含属性:

http://tomcat.apache.org/tomcat-7.0-doc/changelog.html

关于Tomcat 警告 : "Setting property ' showServerInfo' to 'false' did not find a matching property",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28778271/

相关文章:

java - 如何将桌面 Java 应用程序连接到在线数据库(对于傻瓜)?

java - Maven内嵌tomcat部署war文件

java - 当从 servlet 使用 sendError 时,tomcat 不显示错误消息

java - 如何获取文件路径?

javascript - 如何安排任务在我的 tomcat 服务器上每 X 小时运行一次?

java - 无法运行我的 servlet - 错误 404

java - SSL握手时出现 "no cipher suites in common"如何解决?

java - runtime.getruntime().exec ("wscript.exe macro.vbs") 在 Windows Server 2008 上不起作用

tomcat - Docker 和 Kubernetes 上的 symmetryds 用于 Google 容器引擎部署

java - 自定义 Tomcat Realm 和 Lib 目录中的一整套 JAR