What Is New in Apache Tomcat 8.5
This version brings a host of updates focused on modernizing the codebase and improving developer experience. It introduces support for newer specifications while maintaining compatibility with the Java EE 7 and Servlet 3.1 features from Tomcat 8.0.
| Category | Key Changes |
|---|---|
| New Features | HTTP/2 support, TLS virtual hosting, JSON-P 1.0 |
| Improvements | JASPIC 1.1 authentication, WebSocket 1.1 API, JNI library probing |
| Bug Fixes | Numerous fixes for WebSocket, HTTP, and connection handling |
| Deprecated | BIO connector, JMX "Queue" and "ThreadPool" prefixes |
What are the major protocol and API upgrades?
The headline feature is the addition of HTTP/2 support, which significantly improves page load times through multiplexing and header compression. This works alongside the existing TLS virtual hosting capability, allowing multiple certificates on a single connector.
For API enhancements, Tomcat 8.5 now includes JSON-P 1.0 (JSR 353) for processing JSON data and an upgraded WebSocket implementation to the 1.1 API (JSR 356). The JASPIC 1.1 implementation also received updates for better authentication integration.
How did connection handling and I/O improve?
This release continues the push toward non-blocking I/O by formally deprecating the BIO connector. The NIO and NIO2 connectors are now the recommended choices for production environments due to their better scalability and performance under load.
Several bugs related to connection timeout handling and request parsing were fixed, making the server more resilient. The NIO2 connector also saw improvements in its SSL support, fixing issues that could cause premature connection closures.
What changed for JSP and EL expressions?
Tomcat 8.5 includes the Apache Jasper 2.3 engine which implements the JSP 2.3 specification. The main practical difference is in the EL expression handling, which now properly supports lambda expressions.
This means you can use more modern Java 8 idioms directly within your JSP pages. The EL processor was also updated to fix several edge cases in expression evaluation that could cause unexpected behavior.
Were there any classloading or JNI changes?
Yes, the common classloader now uses a different approach for loading JNI libraries. Instead of the previous method, it now uses the system class loader which provides more consistent behavior across different environments.
This change matters because it resolves issues where native libraries might not be found or loaded correctly, particularly in complex deployment scenarios with multiple web applications requiring native code.
FAQ
Should I use HTTP/2 immediately in production?
Yes, but ensure your client browsers support it. HTTP/2 provides real performance benefits, but you'll want to keep HTTP/1.1 available for older clients during transition.
Is the BIO connector removal going to break my existing setup?
It's deprecated, not removed. Your existing config will work, but you should plan to migrate to NIO or NIO2 connectors for future-proofing and better performance.
Does the JSON-P 1.0 support replace my need for other JSON libraries?
It provides a standard API for JSON processing, but you can still use libraries like Jackson or Gson if you prefer their specific features or already have them integrated.
What's the impact of the JNI library loading change?
Most applications won't notice, but if you have custom native libraries, test thoroughly. The new loading approach is more standard but might require path adjustments in rare cases.
Are there any special considerations for upgrading from Tomcat 8.0?
The upgrade path is straightforward since 8.5 maintains API compatibility. Just watch for deprecated features you might be using, particularly the BIO connector and old JMX naming patterns.