Я пытаюсь создать свой собственный ErrorWebExceptionHandler
в Spring Boot 2, расширяя его по умолчанию, но мое приложение не запускается со следующим сообщением:
Caused by: java.lang.IllegalArgumentException: Property 'messageWriters' is required
at org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler.afterPropertiesSet(AbstractErrorWebExceptionHandler.java:214) ~[spring-boot-autoconfigure-2.0.4.RELEASE.jar:2.0.4.RELEASE]
Мой обработчик (код Котлина):
@Component
@Order(-2)
class SampleErrorWebExceptionHandler(
errorAttributes: ErrorAttributes?,
resourceProperties: ResourceProperties?,
errorProperties: ErrorProperties?,
applicationContext: ApplicationContext?
) : DefaultErrorWebExceptionHandler(errorAttributes, resourceProperties, errorProperties, applicationContext) {
override fun logError(request: ServerRequest, errorStatus: HttpStatus) {
// do something
}
}
В чем может быть причина?