errors-spring-boot-starter
errors-spring-boot-starter copied to clipboard
ReactiveErrorAttributes uses inexistent DefaultErrorAttributes(boolean) constructor
Our service uses spring-boot version 2.5.4. When trying to use errors-spring-boot-starter version 1.4.0 we get this exception at startup.
Caused by: java.lang.NoSuchMethodError: void org.springframework.boot.web.reactive.error.DefaultErrorAttributes.<init>(boolean)
at me.alidg.errors.adapter.attributes.ReactiveErrorAttributes.<init>(ReactiveErrorAttributes.java:43)
at me.alidg.errors.conf.ReactiveErrorsAutoConfiguration.errorAttributes(ReactiveErrorsAutoConfiguration.java:38)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at arg.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
It seems that ReactiveErrorAttributes refers to an inexistent constructor in spring DefaultErrorAttributes
public ReactiveErrorAttributes(WebErrorHandlers webErrorHandlers,
HttpErrorAttributesAdapter httpErrorAttributesAdapter) {
super(true);
this.webErrorHandlers = requireNonNull(webErrorHandlers, "Web error handlers is required");
this.httpErrorAttributesAdapter = requireNonNull(httpErrorAttributesAdapter, "Adapter is required");
}