Starting of Tomcat failed from Netbeans

前端 未结 6 1758
星月不相逢
星月不相逢 2020-11-28 21:39

I have problem with starting Apache Tomcat 6 from Netbeans IDE 7.4 (on 7.3 version I had the same troubles. Other people mentioned that this problem exist also in other vers

6条回答
  •  心在旅途
    2020-11-28 21:55

    This affects:

    • All versions of Tomcat starting from 8.5.3 onwards.
    • All versions of Netbeans up to 8.1 (It is fixed in Netbeans 8.2).

    This is because Netbeans does not 'see' that tomcat is started, although it started just fine.

    I have filed Bug #262749 with NetBeans.

    Workaround

    In the server.xml file, in the Connector element for HTTP/1.1, add the following attribute: server="Apache-Coyote/1.1".

    Example:

    
    

    Cause

    The reason for that is that prior to 8.5.3, the default was to set the server header as Apache-Coyote/1.1, while since 8.5.3 this default has now been changed to blank. Apparently Netbeans checks on this header.

    Maybe in the future we can expect a fix in netbeans addressing this issue.

    I was able to trace it back to a change in documentation.

    Tomcat 8.5:

    "Overrides the Server header for the http response. If set, the value for this attribute overrides any Server header set by a web application. If not set, any value specified by the application is used. If the application does not specify a value then no Server header is set."

    Tomcat 8.0:

    "Overrides the Server header for the http response. If set, the value for this attribute overrides the Tomcat default and any Server header set by a web application. If not set, any value specified by the application is used. If the application does not specify a value then Apache-Coyote/1.1 is used. Unless you are paranoid, you won't need this feature."

    That explains the need for explicitly adding the server attribute since version 8.5.3.

提交回复
热议问题