Bug 59210

Summary: Server push example failed in tomcat 8.5.0
Product: Tomcat 8 Reporter: Huxing Zhang <huxing.zhang>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 8.0.x-trunk   
Target Milestone: ----   
Hardware: PC   
OS: Mac OS X 10.1   
Attachments: Fix simple image push example failure

Description Huxing Zhang 2016-03-22 06:40:11 UTC
Steps to reproduce:
1. download tomcat 8.5.0
2. configure a HTTP/2 supported connector over TLS
3. start tomcat
4. visit https://localhost:8443/examples/servlets/serverpush/simpleimage

Observations:

HTTP Status 500 - org.apache.catalina.connector.RequestFacade cannot be cast to org.apache.catalina.connector.Request

type Exception report

message org.apache.catalina.connector.RequestFacade cannot be cast to org.apache.catalina.connector.Request

description The server encountered an internal error that prevented it from fulfilling this request.

exception

java.lang.ClassCastException: org.apache.catalina.connector.RequestFacade cannot be cast to org.apache.catalina.connector.Request
	http2.SimpleImagePush.doGet(SimpleImagePush.java:38)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
note The full stack trace of the root cause is available in the Apache Tomcat/8.5.0 logs.

Apache Tomcat/8.5.0
Comment 1 Huxing Zhang 2016-03-22 06:43:56 UTC
Created attachment 33688 [details]
Fix simple image push example failure
Comment 2 Violeta Georgieva 2016-03-22 10:34:31 UTC
Hi,

Thanks for the report and the patch.
Fix will be available from 8.5.1 onwards.

Regards,
Violeta