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
TomcatService
doesn't work Spring Boot error handling
#3447
Comments
For your example. The About the |
Thanks @kojilin !!
I confirmed
Me too 🤔 yet 😂 |
I am interested in this issue and have tried debugging it. 😎 As a result of doing this, the problematic parts are as follows. Each module in the example produces different results here. I think this is because we made a pure response from armeria/tomcat9/src/main/java/com/linecorp/armeria/server/tomcat/TomcatService.java Line 366 in 922d603
When we create a pure response, And We should be able to call the intended |
Thanks for looking into this issue. Sounds like it's more complicated than initially thought. 😅 Maybe we need to:
|
How about doing it in a different way? As mentioned above, we can register an excption handler using Armeria. (Is it necessary to handle the white label as well..? 🤔) |
Two questions:
|
user? 🤔
It is one of the features provided by spring boot. |
Motivation: No `ActionHook` is set because `TomcarService` makes a pure `Request`. Due to this, default error handling does not work when integrating with Spring Boot. Modifications: - Add `ArmeriaProcessor` per `tomcat` module - Add `ArmeriaEndpoint` to `tomcat8` - `ArmeriaProcessor` and `ArmeriaEndpoint` are created with `MethodHandle` - Add test Result: - Closes #3447
Hi, Armeria team.
I migrated a synchronous Spring Boot application with embedded Tomcat to use Armeria server. As I can't migrate all synchronous code to asynchronous and reactive code, I used
TomcatService
to connect with Armeria and Tomcat. And I found that the TomcatService does not handle error handling describe in the Spring Boot's document:Similarly,
@ControllerAdvice
does not work well:Any JSON response is not respond from the Armeria server. And I guess it's because the "global" error page in the servlet container does not called.
I made an example in my repository. The example have two applications, one is a Spring Boot application with embedded Tomcat. And the other one is similar application but integrated with the Armeria. Tests in both applications describe expected behavior and the Armeria application's test is failed because JSON response does not exist.
The text was updated successfully, but these errors were encountered: