json—我一直在尝试将grails升级到4.0.7,但在运行应用程序时出现错误

70gysomp  于 2021-07-14  发布在  Java
关注(0)|答案(0)|浏览(211)

升级是从3.3.10升级到4.0.7,我遵循了升级说明,但据我所知,spring对这个插件“org.grails.plugins.views json”有一个问题。我在项目中使用了很多json,所以不能仅仅删除插件。
这就是我在应用程序运行失败时遇到的错误。
org.springframework.beans.factory.beancreationexception:创建名为“jsonsmartviewresolver”的bean时出错:通过构造函数示例化bean失败;嵌套异常为org.springframework.beans.beaninstantiationexception:未能示例化[grails.plugin.json.view.mvc.jsonviewresolver]:构造函数引发异常;嵌套异常为java.lang.abstractmethoderror
如果你有什么想法,请告诉我。
谢谢
这是建筑。grad尔

buildscript {
    repositories {
        mavenLocal()
        maven { url "http://artifactory.xxxxxx.xxxx.xxxx.xx/xxx/xx" }
        maven { url "https://repo.xxxxx.xxxx/xxxxxx" }
    }
    dependencies {
        classpath "org.grails:grails-gradle-plugin:$grailsVersion" //4.0.7
        classpath "gradle.plugin.com.energizedwork:idea-gradle-plugins:1.4"
        classpath "org.grails.plugins:hibernate5:${gormVersion - ".RELEASE"}" //7.0.2
        classpath "org.grails.plugins:views-gradle:2.1.0.M1"
        classpath "net.saliman:gradle-cobertura-plugin:2.6.1"
    }
}

version "1.1.2-" + System.getenv("CI_PIPELINE_ID")  // Sprint 18
group "xxxxxxx"

apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "war"
apply plugin: "org.grails.grails-web"
apply plugin: 'org.grails.grails-gsp'
apply plugin: "org.grails.grails-doc"
apply plugin: "org.grails.plugins.views-json"
apply plugin: 'codenarc'
apply plugin: "net.saliman.cobertura"

sourceCompatibility = '1.8'
targetCompatibility = '1.8'

repositories {
    mavenLocal()
    maven { url "http://artifactory.xxxxxx.xxxx.xxxx.xx/xxx/xx" }
    maven { url "https://repo.xxxxx.xxxx/xxxxxx" }
}
configurations {
    all {
        resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
    }
    developmentOnly
    runtimeClasspath {
        extendsFrom developmentOnly
    }
}

dependencies {
    def VERSION = 'xxxxx-xxxxxx-2.0.0-xxxxxxxxx'
    developmentOnly("org.springframework.boot:spring-boot-devtools")

    //XXXXXX dependencies
    compile group: 'xxx.xxxxx.xxx.xxxxxx', name: 'xxxxxx-xxx-api', version: VERSION, changing: true
    compile group: 'xxx.xxxxx.xxx.xxxxxx', name: 'xxxxxx-xxxxxx', version: VERSION, changing: true
    compile group: 'xxx.xxxxx.xxx.xxxxxx', name: 'xxxxxx-xxxxxx', version: VERSION, changing: true

    compile 'xxx.xxxx.xxx.xxxxxx.xxxxxxxx:xxxxxxxxxxx-client:1.4.0'
    compile 'xxx.xxxxx.xxx.xxxxx.plugins3:xxxxxx-xxxxx:2.1.0'
    compile 'xxx.xxxxxx.xxxx.xxxxx.xxxx:xxx-rest-client:1.3.0'

    //Additional dependencies
    compile 'org.grails.plugins:spring-security-core:4.0.3'
    compile 'org.grails.plugins:spring-security-rest:3.0.1'
    compile 'org.grails.plugins:mail:3.0.0'
    compile 'org.grails.plugins:gsp:4.1.0.M3'
    compile 'org.awaitility:awaitility:3.1.6'
    compile 'org.postgresql:postgresql:42.2.6'
    compile 'software.amazon.awssdk:sns:2.7.31'

    // Jobs
    compile 'org.quartz-scheduler:quartz:latest.release'
    compile 'org.grails.plugins:quartz:latest.release'

    // initial dependencies
    compile "org.grails:grails-datastore-gorm-rest-client:6.0.0.M1"
    compile "org.grails:grails-web-common"
    compile "org.springframework.boot:spring-boot-starter-logging"
    compile "org.springframework.boot:spring-boot-autoconfigure"
    compile "org.grails:grails-core"
    compile "org.springframework.boot:spring-boot-starter-actuator"
    compile "org.springframework.boot:spring-boot-starter-tomcat"
    compile "org.grails:grails-plugin-url-mappings"
    compile "org.grails:grails-plugin-rest"
    compile "org.grails:grails-plugin-codecs"
    compile "org.grails:grails-plugin-interceptors"
    compile "org.grails:grails-plugin-services"
    compile "org.grails:grails-plugin-datasource"
    compile "org.grails:grails-plugin-databinding"
    compile "org.grails:grails-web-boot"
    compile "org.grails:grails-logging"
    compile "org.grails.plugins:cache"
    compile "org.grails.plugins:async"
    compile "org.grails.plugins:events"
    compile "org.grails.plugins:hibernate5"
    compile "org.hibernate:hibernate-ehcache"
    compile "org.hibernate:hibernate-core:5.4.0.Final"
    compile "org.grails.plugins:views-json:2.1.0.M1"
    //compile "org.grails.plugins:views-json-templates"
    compile "org.codehaus.groovy.modules.http-builder:http-builder:0.7"
    console "org.grails:grails-console"
    //compile "org.grails:grails-datastore-rest-client-6.1.12.RELEASE"
    profile "org.grails.profiles:rest-api"
    profile 'org.grails.profiles:web'
    runtime "org.glassfish.web:el-impl:2.1.2-b05"
    runtime "com.h2database:h2"
    runtime "org.apache.tomcat:tomcat-jdbc"
    //runtime "org.grails.plugins:views-json:2.0.2"
    //runtime "org.springframework.boot:spring-boot-properties-migrator"
    testCompile "org.grails.plugins:geb"
    testCompile "org.grails:grails-gorm-testing-support"
    testCompile "org.grails:grails-web-testing-support"
    compile 'cglib:cglib-nodep:3.2.12'
    compile 'org.codehaus.jackson:jackson-core-asl:1.8.3'
    compile 'org.codehaus.jackson:jackson-mapper-asl:1.8.3'

}

bootRun {
    jvmArgs('-Dspring.output.ansi.enabled=always')
    sourceResources sourceSets.main
}

war {
    archiveName 'xxxxxxx.war'
}

codenarc {
    toolVersion = "1.4"
}

codenarcMain {
    configFile = file( 'config/codenarc/codenarcMain.groovy' )
}

codenarcTest {
    configFile = file( 'config/codenarc/codenarcTest.groovy' )
}

task codenarcAll {
    group = 'other'
    description = 'Runs all the codenarc checks'
    dependsOn(codenarcTest, codenarcMain)
}

cobertura {
    coverageFormats = ['html']
    coverageIgnoreTrivial = true
}

// TODO not sure what to do about this. Needs to be 'true' for running locally. Needs to be false for building war.
// TODO Could create a new build-war target which turns it off.
grails.pathingJar = true

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题