Java IllegalArgumentException在使用ReactiveCouchbaseRepository时预期会找到rxSingle类的反应适配器,但无法找到
我正在开发一个使用框架和Couchbase DB的应用程序。 Spring为Couchbase提供了JPA实现,我的存储库界面如下所示Java IllegalArgumentException在使用ReactiveCouchbaseRepository时预期会找到rxSingle类的反应适配器,但无法找到,java,spring,reactive-programming,couchbase,spring-webflux,Java,Spring,Reactive Programming,Couchbase,Spring Webflux,我正在开发一个使用框架和Couchbase DB的应用程序。 Spring为Couchbase提供了JPA实现,我的存储库界面如下所示 @Repository public interface ExampleRepository extends ReactiveCouchbaseRepository<Example, String> { } 当我试图通过调用存储库的findById()方法从数据库检索数据时,我得到以下异常 java.lang.IllegalArgumentExc
@Repository
public interface ExampleRepository extends ReactiveCouchbaseRepository<Example, String> {
}
当我试图通过调用存储库的findById()方法从数据库检索数据时,我得到以下异常
java.lang.IllegalArgumentException: Expected to find reactive adapter for class rx.Single but couldn't!
我花了很多时间来弄清楚为什么会出现这个例外,因为没有其他谷歌搜索结果帮我解决了这个问题。我在这里发布解决方案,希望它能对像我这样的人有所帮助 原因 您没有包含反应流的依赖项,或者包含了不兼容的依赖项。 把这一行添加到我的build.gradle救了我的命
compile('io.reactivex:rxjava-reactive-streams')
compile('io.reactivex:rxjava-reactive-streams')