javaee / mojarra

PLEASE NOTE: This project has moved to Eclipse Foundation and will be archived under the JavaEE GitHub Organization. After Feb. 1, 2021, the new location will be github.com/javaee/mojarra. Mojarra - Oracle's implementation of the JavaServer Faces specification
https://github.com/eclipse-ee4j/mojarra
Other
164 stars 58 forks source link

Server Push frequently fails with nested resources #4329

Open Selaron opened 6 years ago

Selaron commented 6 years ago

Mojarra 2.3.3 implementation of Server Push seemes to frequently produce protocol violations when handling nested resources. A nested resource is e.g. a CSS file which points to an image:

CSS reference in Facelet:

Image reference in CSS: background-image: url('#{resource['any.png']}');

The more resources the CSS references, the lower the likelyhood of pushing it all to the client. In case of an error, the web page does completely or partially fail to load / render and is not usable.

Tested with Chrome 64 and Firefox 58.

Server Runtime: Apache Tomcat 9.0.4 JDK 9 Mojarra 2.3.3 CDI-API 1.2 JBOSS Weld-Servlet 2.2.9.Final

Tested with several HTTP/2 Connector Implementations: JSSE NIO, JSSE NIO2, OpenSSL NIO, OpenSSL NIO2

On error, the browsers tend to close connections and trigger some random runtime exceptions on server side (NullPointers, IOExceptions, ...)

As Primefaces uses plenty of nested resources, viewing the showcase with Mojarra 2.3.3, HTTP/2 and Server Push always fails.

Selaron commented 6 years ago

issue4329.zip

Small webapp and instructions to reproduce this issue.

Requires Apache Maven, Apache tomcat 9, OpenSSL if JDK 8 is used, JDK 9 if OpenSSL is not present.

Selaron commented 6 years ago

The root cause is an issue in Apache Tomcat HTTP2 implementation which is to be fixed as of Apache Tomcat 9.0.7 + 8.5.30.

Issue 62177 https://bz.apache.org/bugzilla/show_bug.cgi?id=62177