首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >兼容版本弹簧云,r2dbc

兼容版本弹簧云,r2dbc
EN

Stack Overflow用户
提问于 2019-07-02 17:45:44
回答 1查看 875关注 0票数 3

我尝试在r2dbc中使用spring

我的build.gradle

代码语言:javascript
复制
plugins {
    id 'org.springframework.boot' version '2.2.0.M4'
    id 'java'
}

apply plugin: 'io.spring.dependency-management'

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

repositories {
    mavenCentral()
    maven { url "https://repo.spring.io/snapshot" }
    maven { url "https://repo.spring.io/milestone" }
}

ext {
    set('springCloudVersion', "Greenwich.SR2")
}

dependencies {

     compile('io.jsonwebtoken:jjwt:0.9.1')

    //implementation 'io.jsonwebtoken:jjwt:0.9.1'

    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation 'org.springframework.boot:spring-boot-starter-webflux'
    implementation 'org.springframework.cloud:spring-cloud-starter-config'
    implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
    implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'



    //runtime 'io.r2dbc:r2dbc-pool:0.8.0.M8'
    implementation 'io.r2dbc:r2dbc-postgresql:1.0.0.M7'
    compile 'io.r2dbc:r2dbc-pool:1.0.0.BUILD-SNAPSHOT'
    implementation 'org.springframework.boot.experimental:spring-boot-starter-r2dbc:0.1.0.M1'
    implementation 'org.springframework.boot.experimental:spring-boot-starter-data-r2dbc:0.1.0.M1'



    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'io.projectreactor:reactor-test'
    testImplementation 'org.springframework.security:spring-security-test'
}

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
    }
}

当调用存储库的findAll时,会发生此错误

org.springframework.transaction.reactive.TransactionSynchronizationManager.currentTransaction()Lreactor/core/publisher/Mono;:java.lang.NoSuchMethodError

更新版本到快照似乎解决了有关事务的问题。

EN

回答 1

Stack Overflow用户

发布于 2019-08-20 15:37:40

问题在M1 spring-data-r2dbc中,它由0.1.0.M1 of spring-boot-starter-data-r2dbc提供--您现在需要使用快照构建。

因此,改变:

代码语言:javascript
复制
implementation 'org.springframework.boot.experimental:spring-boot-starter-data-r2dbc:0.1.0.M1'

至:

代码语言:javascript
复制
implementation 'org.springframework.boot.experimental:spring-boot-starter-data-r2dbc:0.1.0.BUILD-SNAPSHOT'

...and,你该走了。

值得注意的是,至少在编写本文时,关系反应性的东西(任何基于r2dbc的东西)都是非常尖端的,在生产中根本没有使用;它的自然含义是,快照构建需要不时地处理bug和不稳定性。这种情况在未来可能会发生变化。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56857677

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档