Record a bug of FeGin

tags: java  springcloud  spring boot  spring  

 HttpResult httpResult = ssoAuthControllerFeign.checkToken(tokens.get(0));

The code came here, and reported an exception when making fegin calls;
The general error is
feign.codec.DecodeException: No qualifying bean of type 'org.springframework.boot.autoconfigure.http.HttpMessageConverters' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at feign.AsyncResponseHandler.decode(AsyncResponseHandler.java:119) ~[feign-core-10.10.1.jar:na] Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: Error has been observed at the following site(s): |_ checkpoint ⇢ org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter [DefaultWebFilterChain] |_ checkpoint ⇢ org.springframework.boot.actuate.metrics.web.reactive.server.MetricsWebFilter [DefaultWebFilterChain] |_ checkpoint ⇢ HTTP GET "/java/sayHi" [ExceptionHandlingWebHandler]

Spring did not load this bean caused;
This problem occurs because Gateway does not have a SpringMVC that uses WebFlux's way, so there is no converter;
[Suddenly I remembered the previous introduction of Gateway dependencies, I prompt me Spring-boot-web conflict to let me delete it. It turns out that this is the backhand]

So we only need to manually introduce this bean.
Can be under the startup class. You can also have another configuration class, manually injecting this bean into the container, and the problem is solved.

@Configuration
public class Config {
    @Bean
    @ConditionalOnMissingBean
    public HttpMessageConverters messageConverters(ObjectProvider<HttpMessageConverter<?>> converters) {
        return new HttpMessageConverters(converters.orderedStream().collect(Collectors.toList()));
    }
}

Intelligent Recommendation

Record BUG, ​​record the good life

Recording the .NET+IIS server causes the cookie cannot be written to the browser BUG performance BUG search BUG advanced BUG solution BUG performance Yesterday, because the .NET WEB API project writte...

Bug record - idea startup

Idea error: Error running $classname: Command line is too long. Shorten command line for $classname.   1. Follow the prompts to modify the configuration of the class, select the jar manifest (eac...

A badly synchronized bug record.

Last night, I received a QA report saying that a lot of data in the page could not be displayed. Don't worry, don't worry, first protect the scene, continue testing with another server in debug mode, ...

CSI Bug modification record

demand: There are 3 fields in the table A:S2s, cust_id, form_date and isTransmit. In the table B:Flag, there are 3 fields: cust_id, startDate and endDate. Please find some records in S2s. The constrai...

Record a bug resolution process

The day before using jython full build data, there will always be character garbled problems, wasting a lot of time to find the cause of the problem, and record the problem solving process.   Pro...

More Recommendation

Record a different and different bug

This program is to process the image in a web directory, but to perform another naming and saving process, and then return the path of the new image. The result is that the three lines that are commen...

BUG resolution record

Climbing the bottom 1. ITEM ONE ** Report key information ** ** problem lies in : ** resultMap ——> resultType ** Changed code :** 2. ITEM TWO ** Error message** ** Reason for error ** M...

Working bug problem record

      This problem requires adding a keyboard enter event for the OK key, ie:   Problem Solution: Bind the native enter event on the input box:           T...

Push BUG exclusion record

Try to write PHP push yourself, so remote debugging is very troublesome. Now define the type Use other methods to complete the subtask, that is, the single-letter context tag has information....

Android development, common INTENT example

2019 Unicorn Enterprise Heavy Glour Recruitment Python Engineer Standard >>> One: Method for ending actvity I know that there are four ways to end a current Activity:     ...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top