<?xml version="1.0" encoding="UTF-8"?>
<document>

  <properties>
    <author>Apache Tomcat Project</author>
    <title>Migration Guide - Tomcat 8.5.x</title>
  </properties>

<body>

<section name="Table of Contents">
<toc/>
</section>

<section name="General">

<p>Please read the general <a href="migration.html">Migration Guide page</a>
first, for common considerations that apply to migration or upgrade between
versions of Apache Tomcat<sup>&#174;</sup>.</p>

</section>

<section name="Migrating from 8.0.x to 8.5.x">

  <p> This section lists all the known changes between 8.0.x and 8.5.x which may
  cause backwards compatibility problems when upgrading.</p>

  <subsection name="BIO connector removed">

    <p>The Java blocking IO implementation (BIO) for both HTTP and AJP has been
    removed. Users are recommended to switch to the Java non-blocking IO
    implementation (NIO). As of Tomcat 8.5.17, if a BIO Connector is explicitly
    configured, rather than failing to start the Connector, Tomcat will
    automatically switch the Connector to use the NIO implementation and log a
    warning.</p>

  </subsection>

  <subsection name="HTTP connector changes">
    <p>
      HTTP reason phrases have been <a href="https://bz.apache.org/bugzilla/show_bug.cgi?id=60362">removed by default</a>,
      but can be re-enabled using the <code>sendReasonPhrase</code>
      <a href="https://tomcat.apache.org/tomcat-8.5-doc/config/http.html#Common_Attributes">configuration attribute</a>.
    </p>
  </subsection>
  <subsection name="Comet support removed">

    <p>Comet support has been removed without a direct replacement. Applications
    using Comet are recommended to migrate to WebSockets.</p>

  </subsection>

  <subsection name="HTTP/2 support added">

    <p>HTTP/2 is supported for h2 (over TLS, negotiated via ALPN) and h2c (clear
    text, negotiated via HTTP/1.1 upgrade). HTTP/2 needs to be explicitly
    enabled for a connector. To enable it, insert
    <source><![CDATA[<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />]]></source>
    inside the connector for which you wish to enable HTTP/2. Note that to
    enable HTTP/2 for a secure NIO or NIO2 connector, those connectors must be
    using the OpenSSL engine for TLS.</p>

  </subsection>

  <subsection name="TLS virtual hosting and multiple certificate support added">

    <p>Tomcat 8.5 supports multiple TLS virtual hosts for a single connector with
    each virtual host able to support multiple certificates. Virtual host
    definitions are nested inside the Connector element with the default
    specified using the <strong>defaultSSLHostConfigName</strong> attribute on the
    Connector if more than one virtual host is specified. Certificate
    definitions are nested inside the virtual host.</p>
    
    <p>The following example shows how to use this to configure a single
    APR/native connector for multiple TLS virtual hosts with each host having
    both an RSA and EC certificate.
    
<source><![CDATA[
<Connector port="8443"
           protocol="org.apache.coyote.http11.Http11AprProtocol"
           maxThreads="150"
           SSLEnabled="true"
           defaultSSLHostConfigName="openoffice.apache.org" >
    <SSLHostConfig hostName="openoffice.apache.org" >
        <Certificate certificateKeyFile="conf/openoffice.apache.org-rsa-key.pem"
                     certificateFile="conf/openoffice.apache.org-rsa-cert.pem"
                     type="RSA" />
        <Certificate certificateKeyFile="conf/openoffice.apache.org-ec-key.pem"
                     certificateFile="conf/openoffice.apache.org-ec-cert.pem"
                     type="EC" />
    </SSLHostConfig>
    <SSLHostConfig hostName="www.openoffice.org" >
        <Certificate certificateKeyFile="conf/www.openoffice.org-rsa-key.pem"
                     certificateFile="conf/www.openoffice.org-rsa-cert.pem"
                     type="RSA" />
        <Certificate certificateKeyFile="conf/www.openoffice.org-ec-key.pem"
                     certificateFile="conf/www.openoffice.org-ec-cert.pem"
                     type="EC" />
    </SSLHostConfig>
</Connector>
]]></source></p>

  </subsection>

  <subsection name="Internal APIs">
  
    <p>Whilst the Tomcat 8.5 internal API is broadly compatible with Tomcat 8.0
    there have been many changes at the detail level and they are not binary
    compatible. Developers of custom components that interact with Tomcat&apos;s
    internals should review the JavaDoc for the relevant API.</p>

    <p>Of particular note are:</p>
    <ul>
      <li>Significant refactoring has taken place throughout the connectors to
          reduce duplicate code and to align behaviour across
          implementations.</li>
      <li>The deprecated <code>digest</code> attribute has been removed from the
          <code>Realm</code>. This must now be configured via a
          <code>CredentialHandler</code>.</li>
      <li>The <code>AuthenticatorBase</code> implementation has been changed to
          call <code>doAuthenticate()</code> rather than
          <code>authenticate()</code> on sub-classes.</li>
    </ul>

  </subsection>
  
  <subsection name="JSR-77 implementation removed">

    <p>The JSR-77 implementation is incomplete and has been removed in 8.5.x.
    Specifically, the following methods that exposed to JMX have been removed.
    </p>

    <ul>
      <li><code>StandardContext.getServlets()</code></li>
      <li><code>StandardContext.isStateManageable()</code></li>
      <li><code>StandardContext.getDeploymentDescriptor()</code></li>
      <li><code>StandardWrapper.isStateManageable()</code></li>
    </ul>
  </subsection>

  <subsection name="Clustering">

    <p><code>MessageDispatch15Interceptor</code> had been used to add the Java 5
    features to MessageDispatchInterceptor.
    <code>MessageDispatch15Interceptor</code> has been removed in Tomcat 8.5.x
    by merging the Java 5 features to <code>MessageDispatchInterceptor</code>.
    </p>

  </subsection>

  <subsection name="InstanceListener removed">

    <p>The support of InstanceListener has been removed in 8.5.x.
    Specifically, the following classes have been removed.
    </p>

    <ul>
      <li><code>org.apache.catalina.InstanceListener</code></li>
      <li><code>org.apache.catalina.InstanceEvent</code></li>
      <li><code>org.apache.catalina.util.InstanceSupport</code></li>
    </ul>
  </subsection>

  <subsection name="SessionManager">

    <p>The following session manager attributes have been completely removed in
    8.5.</p>

    <ul>
      <li><code>distributable</code></li>
      <li><code>maxInactiveInterval</code></li>
      <li><code>sessionIdLength</code></li>
    </ul>

    <p>The replacements are as follows:</p>
    <ul>
      <li>The <code>distributable</code> attribute has been deprecated in 8.0
          and specified value is ignored. This should be configured via the
          Context. The value is inherited based on the presence or absence of
          the <code>&lt;distributable /&gt;</code> element in
          <code>/WEB-INF/web.xml.</code></li>
      <li>The <code>maxInactiveInterval</code> attribute has been deprecated in
          8.0. If the value is specified, a warning log is issued. This should
          be configured via the Context. The value is inherited based on the
          value of the <code>&lt;session-timeout&gt;</code> element in
          <code>/WEB-INF/web.xml</code>.</li>
      <li>The <code>sessionIdLength</code> attribute of <code>Manager</code> has
          been replaced by <code>sessionIdLength</code> attribute of
          <code>SessionIdGenerator</code>.</li>
    </ul>
  </subsection>

  <subsection name="Cookies">
  
    <p>The default <code>CookieProcessor</code> is now the
    <code>Rfc6265CookieProcessor</code>. The <code>CookieProcessor</code> is
    configurable per <code>Context</code> and the
    <code>LegacyCookieProcessor</code> may be used to obtain the 8.0.x
    behaviour.</p>

  </subsection>

  <subsection name="Web applications">
  
    <p>The Manager and HostManager web applications are configured by default
       with a <code>RemoteAddrValve</code> that limits access to those
       applications to connections from localhost.</p>

  </subsection>

  <subsection name="Context configurations">

    <p>The <code>clearReferencesStatic</code> attribute has been removed in
    8.5.x.</p>

  </subsection>

</section>

<section name="Upgrading 8.5.x">
  <p>When upgrading instances of Apache Tomcat from one version of Tomcat 8 to
  another, particularly when using separate locations for $CATALINA_HOME and
  $CATALINA_BASE, it is necessary to ensure that any changes in the
  configuration files such as new attributes and changes to defaults are applied
  as part of the upgrade. To assist with the identification of these changes,
  the form below may be used to view the differences between the configuration
  files in different versions of Tomcat 8.</p>

  <subsection name="Tomcat 8.5.x noteable changes">
    <p>The Tomcat developers aim for each patch release to be fully backwards
       compatible with the previous release.  Occasionally, it is necessary to
       break backwards compatibility in order to fix a bug. In most cases, these
       changes will go unnoticed. This section lists changes that are not fully
       backwards compatible and might cause breakage when upgrading.</p>
    <ul>
      <li>
        In 8.5.88 onwards, the default value for the Connector attribute
        <code>maxParameterCount</code> has been reduced from 10,000 to 1,000.
      </li>
      <li><p>In 8.5.51 onwards, the default listen <strong>address</strong> of
        the AJP Connector was changed to the loopback address rather than all
        addresses.</p>
        <p>Reference:  <a href="tomcat-8.5-doc/config/ajp.html">AJP
        connector</a>.</p>
      </li>
      <li><p>In 8.5.51 onwards, the <strong>requiredSecret</strong> attribute
        of the AJP Connector was deprecated and replaced by the
        <strong>secret</strong> attribute.</p>
        <p>Reference:  <a href="tomcat-8.5-doc/config/ajp.html">AJP
        connector</a>.</p>
      </li>
      <li><p>In 8.5.51 onwards, the <strong>secretRequired</strong> attribute
        was added to the AJP Connector. If set to <code>true</code>, the
        default, the AJP Connector will not start unless a
        <strong>secret</strong> has been specified.</p>
        <p>Reference:  <a href="tomcat-8.5-doc/config/ajp.html">AJP
        connector</a>.</p>
      </li>
      <li><p>In 8.5.51 onwards, the
        <strong>allowedRequestAttributesPattern</strong> attribute was added to
        the AJP Connector. Requests with unrecognised attributes will now be
        blocked with a 403.</p>
        <p>Reference:  <a href="tomcat-8.5-doc/config/ajp.html">AJP
        connector</a>.</p>
      </li>
      <li><p>In 8.5.64 onwards, the semantics of the
        <code>HostConfig.check(String)</code> method have changed. Rather than
        marking the application as serviced before calling the method, the
        method will mark the application as serviced before checking
        resources and then un-mark the application as being serviced after the
        checks are complete. If the application is marked as serviced when the
        method is called, the method will be a NO-OP.</p>
      </li>
      <li><p>In 8.5.70 onwards, Tomcat no longer adds an "Expires" HTTP
        response header when adding "Cache-Control: private" due to a
        CONFIDENTIAL transport-guarantee. This will likely cause a change
        in caching behavior for applications that do not explicitly set
        their own headers but rely on Tomcat's previous behavior. If you
        wish to disable caching, you will need to configure it explicitly
        in your application. See <a href="https://bz.apache.org/bugzilla/show_bug.cgi?id=65513">BZ 65513</a>
        for more information.</p>
      </li>
      <li><p>In 8.5.71 onwards, as a result of the updated fork of Commons
        FileUpload now using <code>java.nio.file.Files</code>, applications
        using multi-part uploads need to ensure that the JVM is configured with
        sufficient direct memory to store all in progress multi-part
        uploads.</p>
      </li>
      <li><p>In 8.5.74 onwards, the system property
        <code>org.apache.juli.AsyncLoggerPollInterval</code> is no longer
        used.</p>
      </li>
      <li><p>In 8.5.75 and onwards, the JmxRemoteLifecycleListener has been
          removed. Note that modern JVMs no longer need the features provided
          by JMXLifecycleListener.</p></li>
      <li><p>In 8.5.75 and onwards, the <code>maxSavePostSize</code> attribute
        on the <code>&lt;Connector&gt;</code> also applies to a request body
        present when an HTTP/1.1 upgrade is being performed.</p>
      </li>
      <li><p>In 8.5.76 and onwards, Tomcat release builds are performed using
        Java 11 in "Java 7 mode". This should produce a fully-compatible
        release that should work under Java 7 or later. Any problems you
        experience such as class-file-version errors, method-mismatch errors,
        or JVM verifiers should be reported to the Tomcat team immediately.</p>
      </li>
    </ul>
  </subsection>
  
  <subsection name="Tomcat 8.5.x configuration file differences">

    <p>Select a configuration file, old version and new version from the boxes
    below and then click &quot;View differences&quot; to see the differences.
    The differences will be shown in a new tab/window.</p>

    <p><b>Note:</b> If there are no differences you will see an error page.</p>

    <form action="https://gitbox.apache.org/filediff"
          method="get"
          target="_blank">

    <input type="hidden" name="repo" value="tomcat.git"/>

    <p><label>Configuration file:
    <select name="file">
    <option value="conf" selected="selected">All configuration files</option>
    <option value="conf/catalina.policy">catalina.policy</option>
    <option value="conf/catalina.properties">catalina.properties</option>
    <option value="conf/context.xml">context.xml</option>
    <option value="conf/logging.properties">logging.properties</option>
    <option value="conf/server.xml">server.xml</option>
    <option value="conf/tomcat-users.xml">tomcat-users.xml</option>
    <option value="conf/web.xml">web.xml</option>
    </select></label>
    </p>
    <p><label>Old version:
    <select name="origin">
    <option value="8.5.0">8.5.0</option>
    <option value="8.5.2">8.5.2</option>
    <option value="8.5.3">8.5.3</option>
    <option value="8.5.4">8.5.4</option>
    <option value="8.5.5">8.5.5</option>
    <option value="8.5.6">8.5.6</option>
    <option value="8.5.8">8.5.8</option>
    <option value="8.5.9">8.5.9</option>
    <option value="8.5.11">8.5.11</option>
    <option value="8.5.12">8.5.12</option>
    <option value="8.5.13">8.5.13</option>
    <option value="8.5.14">8.5.14</option>
    <option value="8.5.15">8.5.15</option>
    <option value="8.5.16">8.5.16</option>
    <option value="8.5.20">8.5.20</option>
    <option value="8.5.21">8.5.21</option>
    <option value="8.5.23">8.5.23</option>
    <option value="8.5.24">8.5.24</option>
    <option value="8.5.27">8.5.27</option>
    <option value="8.5.28">8.5.28</option>
    <option value="8.5.29">8.5.29</option>
    <option value="8.5.30">8.5.30</option>
    <option value="8.5.31">8.5.31</option>
    <option value="8.5.32">8.5.32</option>
    <option value="8.5.33">8.5.33</option>
    <option value="8.5.34">8.5.34</option>
    <option value="8.5.35">8.5.35</option>
    <option value="8.5.37">8.5.37</option>
    <option value="8.5.38">8.5.38</option>
    <option value="8.5.39">8.5.39</option>
    <option value="8.5.40">8.5.40</option>
    <option value="8.5.41">8.5.41</option>
    <option value="8.5.42">8.5.42</option>
    <option value="8.5.43">8.5.43</option>
    <option value="8.5.45">8.5.45</option>
    <option value="8.5.46">8.5.46</option>
    <option value="8.5.47">8.5.47</option>
    <option value="8.5.49">8.5.49</option>
    <option value="8.5.50">8.5.50</option>
    <option value="8.5.51">8.5.51</option>
    <option value="8.5.53">8.5.53</option>
    <option value="8.5.54">8.5.54</option>
    <option value="8.5.55">8.5.55</option>
    <option value="8.5.56">8.5.56</option>
    <option value="8.5.57">8.5.57</option>
    <option value="8.5.58">8.5.58</option>
    <option value="8.5.59">8.5.59</option>
    <option value="8.5.60">8.5.60</option>
    <option value="8.5.61">8.5.61</option>
    <option value="8.5.63">8.5.63</option>
    <option value="8.5.64">8.5.64</option>
    <option value="8.5.65">8.5.65</option>
    <option value="8.5.66">8.5.66</option>
    <option value="8.5.68">8.5.68</option>
    <option value="8.5.69">8.5.69</option>
    <option value="8.5.70">8.5.70</option>
    <option value="8.5.71">8.5.71</option>
    <option value="8.5.72">8.5.72</option>
    <option value="8.5.73">8.5.73</option>
    <option value="8.5.75">8.5.75</option>
    <option value="8.5.76">8.5.76</option>
    <option value="8.5.77">8.5.77</option>
    <option value="8.5.78">8.5.78</option>
    <option value="8.5.79">8.5.79</option>
    <option value="8.5.81">8.5.81</option>
    <option value="8.5.82">8.5.82</option>
    <option value="8.5.83">8.5.83</option>
    <option value="8.5.84">8.5.84</option>
    <option value="8.5.85">8.5.85</option>
    <option value="8.5.86">8.5.86</option>
    <option value="8.5.87">8.5.87</option>
    <option value="8.5.88">8.5.88</option>
    <option value="8.5.89">8.5.89</option>
    <option value="8.5.90">8.5.90</option>
    <option value="8.5.91">8.5.91</option>
    <option value="8.5.92">8.5.92</option>
    <option value="8.5.93">8.5.93</option>
    <option value="8.5.94">8.5.94</option>
    <option value="8.5.95">8.5.95</option>
    <option value="8.5.96">8.5.96</option>
    <option value="8.5.97">8.5.97</option>
    <option value="8.5.98">8.5.98</option>
    <option value="8.5.99" selected="selected">8.5.99</option>
    <option value="8.5.100">8.5.100</option>
    </select>,</label> <label>new version:
    <select name="target">
    <option value="8.5.0">8.5.0</option>
    <option value="8.5.2">8.5.2</option>
    <option value="8.5.3">8.5.3</option>
    <option value="8.5.4">8.5.4</option>
    <option value="8.5.5">8.5.5</option>
    <option value="8.5.6">8.5.6</option>
    <option value="8.5.8">8.5.8</option>
    <option value="8.5.9">8.5.9</option>
    <option value="8.5.11">8.5.11</option>
    <option value="8.5.12">8.5.12</option>
    <option value="8.5.13">8.5.13</option>
    <option value="8.5.14">8.5.14</option>
    <option value="8.5.15">8.5.15</option>
    <option value="8.5.16">8.5.16</option>
    <option value="8.5.20">8.5.20</option>
    <option value="8.5.21">8.5.21</option>
    <option value="8.5.23">8.5.23</option>
    <option value="8.5.24">8.5.24</option>
    <option value="8.5.27">8.5.27</option>
    <option value="8.5.28">8.5.28</option>
    <option value="8.5.29">8.5.29</option>
    <option value="8.5.30">8.5.30</option>
    <option value="8.5.31">8.5.31</option>
    <option value="8.5.32">8.5.32</option>
    <option value="8.5.33">8.5.33</option>
    <option value="8.5.34">8.5.34</option>
    <option value="8.5.35">8.5.35</option>
    <option value="8.5.37">8.5.37</option>
    <option value="8.5.38">8.5.38</option>
    <option value="8.5.39">8.5.39</option>
    <option value="8.5.40">8.5.40</option>
    <option value="8.5.41">8.5.41</option>
    <option value="8.5.42">8.5.42</option>
    <option value="8.5.43">8.5.43</option>
    <option value="8.5.45">8.5.45</option>
    <option value="8.5.46">8.5.46</option>
    <option value="8.5.47">8.5.47</option>
    <option value="8.5.49">8.5.49</option>
    <option value="8.5.50">8.5.50</option>
    <option value="8.5.51">8.5.51</option>
    <option value="8.5.53">8.5.53</option>
    <option value="8.5.54">8.5.54</option>
    <option value="8.5.55">8.5.55</option>
    <option value="8.5.56">8.5.56</option>
    <option value="8.5.57">8.5.57</option>
    <option value="8.5.58">8.5.58</option>
    <option value="8.5.59">8.5.59</option>
    <option value="8.5.60">8.5.60</option>
    <option value="8.5.61">8.5.61</option>
    <option value="8.5.63">8.5.63</option>
    <option value="8.5.64">8.5.64</option>
    <option value="8.5.65">8.5.65</option>
    <option value="8.5.66">8.5.66</option>
    <option value="8.5.68">8.5.68</option>
    <option value="8.5.69">8.5.69</option>
    <option value="8.5.70">8.5.70</option>
    <option value="8.5.71">8.5.71</option>
    <option value="8.5.72">8.5.72</option>
    <option value="8.5.73">8.5.73</option>
    <option value="8.5.75">8.5.75</option>
    <option value="8.5.76">8.5.76</option>
    <option value="8.5.77">8.5.77</option>
    <option value="8.5.78">8.5.78</option>
    <option value="8.5.79">8.5.79</option>
    <option value="8.5.81">8.5.81</option>
    <option value="8.5.82">8.5.82</option>
    <option value="8.5.83">8.5.83</option>
    <option value="8.5.84">8.5.84</option>
    <option value="8.5.85">8.5.85</option>
    <option value="8.5.86">8.5.86</option>
    <option value="8.5.87">8.5.87</option>
    <option value="8.5.88">8.5.88</option>
    <option value="8.5.89">8.5.89</option>
    <option value="8.5.90">8.5.90</option>
    <option value="8.5.91">8.5.91</option>
    <option value="8.5.92">8.5.92</option>
    <option value="8.5.93">8.5.93</option>
    <option value="8.5.94">8.5.94</option>
    <option value="8.5.95">8.5.95</option>
    <option value="8.5.96">8.5.96</option>
    <option value="8.5.97">8.5.97</option>
    <option value="8.5.98">8.5.98</option>
    <option value="8.5.99">8.5.99</option>
    <option value="8.5.100" selected="selected">8.5.100</option>
    <option value="HEAD">trunk (unreleased)</option>
    </select></label>
    </p>

    <p>
    <button>View Differences</button>
    </p>
    </form>
    <p>You can also use a Git command similar to the following from within a
       working copy:</p>
    <source>git diff 8.5.0 8.5.20 -- conf/</source>
  </subsection>
  
</section>

</body>
</document>
