You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spring allows classes annotated with @ControllerAdvice and containing @ExceptionHandlers to be extended and overridden as necessary, such that the behaviours of the overridden methods take precedence over base methods.
It seems we can not similarly inherit and extend classes annotated with @GrpcAdvice and containing @GrpcExceptionHandlers.
Steps to Reproduce
With Proper Annotations and Overriding in Derived Class
If one tries to extend one @GrpcAdvice class with another, providing the @GrpcExceptionHandler annotations as shown below, the application is unable to start up with Fatal Exception: Ambiguous "@GrpcExceptionHandler" method mapped for BadRequestException..
Without @GrpcExceptionHandler annotation in Derived Class
If one tries to extend one @GrpcAdvice class with another as shown below, without @GrpcExceptionHandler annotation, the application is unable to start up with Fatal Exception: [net/devh/boot/grpc/server/autoconfigure/GrpcAdviceAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: @GrpcExceptionHandler annotation not found..
The Problem
Spring allows classes annotated with
@ControllerAdvice
and containing@ExceptionHandler
s to be extended and overridden as necessary, such that the behaviours of the overridden methods take precedence over base methods.It seems we can not similarly inherit and extend classes annotated with
@GrpcAdvice
and containing@GrpcExceptionHandler
s.Steps to Reproduce
With Proper Annotations and Overriding in Derived Class
If one tries to extend one
@GrpcAdvice
class with another, providing the@GrpcExceptionHandler
annotations as shown below, the application is unable to start up with Fatal Exception:Ambiguous "@GrpcExceptionHandler" method mapped for BadRequestException.
.Without
@GrpcExceptionHandler
annotation in Derived ClassIf one tries to extend one
@GrpcAdvice
class with another as shown below, without@GrpcExceptionHandler
annotation, the application is unable to start up with Fatal Exception:[net/devh/boot/grpc/server/autoconfigure/GrpcAdviceAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: @GrpcExceptionHandler annotation not found.
.Additional Context
The dependency being used is:
Other versions being used are as follows:
The text was updated successfully, but these errors were encountered: