使用Couchbase和Redis时应用程序中有多个customConversions bean [英] Multiple customConversions beans in application while using couchbase and redis

查看:59
本文介绍了使用Couchbase和Redis时应用程序中有多个customConversions bean的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我正在将Couchbase用作DB和Redis进行缓存.

I am using couchbase as DB and Redis for caching purposes in my application.

但是,我无法使其正常运行.该应用程序在启动过程中引发以下错误.

However, I am not able to make it work. The application throws the following error during startup.

No qualifying bean of type 'org.springframework.data.convert.CustomConversions' available: expected single matching bean but found 2: couchbaseCustomConversions,redisCustomConversions

我该如何解决?请帮助

推荐答案

在couchbaseconfiguration类中添加自定义bean定义,即,扩展AbstractCouchbaseConfiguration的类将解决此问题.

Adding a custom bean definition in the couchbaseconfiguration class,i.e the class which extends AbstractCouchbaseConfiguration would solve the issue.

@Bean
    public CustomConversions customConversions() {
        return super.customConversions();
    }

这篇关于使用Couchbase和Redis时应用程序中有多个customConversions bean的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆