Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embedded tomcat server unable to parse grpc response - ClassCastException #2947

Open
siganapathy opened this issue May 8, 2023 · 2 comments

Comments

@siganapathy
Copy link

Describe the bug
I am trying to enable grpc support for my reactive spring cloud gateway based application. We use tomcat server instead of the default netty server. Currently getting this error while my application parses the grpc response from the server.

java.lang.ClassCastException: class org.apache.catalina.connector.ResponseFacade cannot be cast to class reactor.netty.http.server.HttpServerResponse (org.apache.catalina.connector.ResponseFacade and reactor.netty.http.server.HttpServerResponse are in unnamed module of loader 'app')
	at org.springframework.cloud.gateway.filter.headers.GRPCResponseHeadersFilter.filter(GRPCResponseHeadersFilter.java:44)

Environment/versions:
Spring boot - 3.0.6, Spring cloud - 2022.0.2, JDK - 17
Issue also reproducible with Spring boot - 2.7.x, Spring cloud - 2021.0.5, JDK - 11

Sample
Issue reproduced here

@Albertoimpl FYI, Raised this as an issue. Thanks.

@Albertoimpl
Copy link
Member

Thanks a lot for the reproducer, I understand what the problem is now.
Sadly, @siganapathy Spring Cloud Gateway does not support Tomcat today but the good news is that support for it is in the making: #2949

Also, as a note, your gRPC clients and gRPC servers can be running in Tomcat without any problems while Spring Cloud Gateway keeps running using Netty.

@spencergibb
Copy link
Member

This will not be fixed by #2949, but by #145 as I don't know if GRPC support will land in the initial MVC implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants