ryc1995
南橘ryc
2019-08-02 15:36
采纳率: 100%
浏览 476
已采纳

基于gradle的Springcloud 配置 运行出错 这个问题该怎么解决

出错代码:


Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2019-08-02 15:29:30.856 ERROR 5440 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method feignAccessLogger in com.cmpay.lemon.framework.autoconfigure.feign.FeignAutoConfiguration required a bean of type 'com.cmpay.lemon.common.codec.DesensitizationObjectEncoder' that could not be found.
    - Bean method 'desensitizationObjectEncoder' not loaded because @ConditionalOnClass did not find required class 'com.cmpay.lemon.framework.jackson.sensitive.DesensitizationObjectMapperObjectCodec'


Action:

Consider revisiting the conditions above or defining a bean of type 'com.cmpay.lemon.common.codec.DesensitizationObjectEncoder' in your configuration.


Process finished with exit code 1

出错的DesensitizationObjectEncoder的内容


@Configuration
@ConditionalOnClass({Desensitization.class})
public class DesensitizationConfiguration {

    @Bean
    public DesensitizationConfigurer desensitizationConfigurer() {
        return new DesensitizationConfigurer();
    }

    @Configuration
    @ConditionalOnClass(DesensitizationObjectMapperObjectCodec.class)
    public static class DesensitizationObjectEncoderConfiguration {

        @Bean
        @ConditionalOnMissingBean
        public DesensitizationObjectEncoder desensitizationObjectEncoder(Jackson2ObjectMapperBuilder builder,
                                                                         DesensitizationConfigurer configurer) {
            ObjectMapper objectMapper = builder.build();
            return new DesensitizationObjectMapperObjectCodec(objectMapper, configurer);
        }

    }

}

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

相关推荐