尝试将Groovy应用程序从2.3.1升级到3.3.15,我得到了很多错误,如下所示,任何帮助都将不胜感激

nbysray5  于 2022-11-01  发布在  其他
关注(0)|答案(1)|浏览(137)

| 2022-10-11 17:19:04.189错误--- [ main]操作系统启动. Spring应用程序:应用程序启动失败
出现异常错误:无法处理配置类[splitseasontickets.main4.Application]的导入候选项;嵌套的异常是java.lang.IllegalStateException:无法排除以下类,因为它们不是自动配置类:- org.springframework. Boot .自动配置.消息源自动配置

at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:561)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:187)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:308)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:272)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:92)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:123)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:666)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:353)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:300)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:55)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:374)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:363)
    at grails.boot.GrailsApp$run.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:136)
    at splitseasontickets.main4.Application.main(Application.groovy:8)

导致错误的原因:java.lang.无法排除以下类,因为它们不是自动配置类:- org.springframework. Boot .自动配置.消息源自动配置

at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.handleInvalidExcludes(AutoConfigurationImportSelector.java:183)
    at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.checkExcludedClasses(AutoConfigurationImportSelector.java:169)
    at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.selectImports(AutoConfigurationImportSelector.java:97)
    at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:552)
    ... 19 common frames omitted

失败:生成失败,出现异常.

  • 问题:执行任务“:bootRun”失败。

进程'命令'/usr/lib/jvm/java-8-openjdk-amd 64/bin/java ''已完成,但退出值为非零值1

  • 尝试:使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。|错误无法启动服务器(使用--stacktrace可查看完整跟踪)

我在gradle中使用以下依赖项...

buildscript {
    repositories {
        mavenLocal()
        maven { url "https://repo.grails.org/grails/core" }
    }
    dependencies {
        classpath "org.grails:grails-gradle-plugin:$grailsVersion"
        classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
        classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.15.1"
    }
}

version "0.1"
group "splitseasontickets.main4"

apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"asset-pipeline"
apply plugin:"org.grails.grails-gsp"

repositories {
    mavenLocal()
    maven { url "https://repo.grails.org/grails/core" }
    mavenCentral()
}

dependencies {
    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-web-boot"
    compile "org.grails:grails-logging"
    compile "org.grails:grails-plugin-rest"
    compile "org.grails:grails-plugin-databinding"
    compile "org.grails:grails-plugin-i18n"
    compile "org.grails:grails-plugin-services"
    compile "org.grails:grails-plugin-url-mappings"
    compile "org.grails:grails-plugin-interceptors"
    compile "org.grails.plugins:cache"
    compile "org.grails.plugins:async"
    compile "org.grails.plugins:scaffolding"
    compile "org.grails.plugins:events"
    compile "org.grails.plugins:hibernate5"
    compile "org.hibernate:hibernate-core:5.1.16.Final"
    compile "org.grails.plugins:gsp"
    console "org.grails:grails-console"
    profile "org.grails.profiles:web"
    runtime 'org.glassfish.web:el-impl:2.2'
    runtime "com.h2database:h2"
    runtime "org.apache.tomcat:tomcat-jdbc"
    runtime 'com.bertramlabs.plugins:asset-pipeline-grails:3.4.7'
    testCompile "org.grails:grails-gorm-testing-support"
    testCompile "org.grails.plugins:geb"
    testCompile "org.grails:grails-web-testing-support"
    testCompile "org.grails.plugins:geb:1.1.2"
    testRuntime 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.52.0'
    testRuntime 'net.sourceforge.htmlunit:htmlunit:2.64.0'
    testRuntime 'org.seleniumhq.selenium:selenium-chrome-driver:4.5.0'
   // compile "org.grails.plugins:hibernate"
    compile "org.hibernate:hibernate-ehcache"
    testCompile "org.grails:grails-plugin-testing"
    // Note: It is recommended to update to a more robust driver (Chrome, Firefox etc.)
    compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.1-beta2'
    compile 'org.grails:grails-datastore-rest-client:6.1.9.RELEASE'
    compile 'org.codehaus.groovy:groovy-sql:3.0.13'
    //compile group: 'org.grails', name: 'grails-web-common', version: '3.0.17'
   compile group: 'org.grails', name: 'grails-core', version: '3.1.14'
    compile group: 'net.sourceforge.jexcelapi', name: 'jxl', version: '2.6.12'
    compile group: 'org.jmdware', name: 's3-bucket-recursor', version: '1.0.1'

    // compile group: 'org.apache.camel', name: 'camel-grape', version: '3.19.0'

    //compile 'org.grails.plugins:spring-security-core:3.0.3'
    compile 'org.grails.plugins:spring-security-core:3.2.0.M1'
    compile 'org.grails.plugins:spring-security-ui:3.1.2'
    compile 'org.springframework.boot:spring-boot-starter-security:1.5.4.RELEASE'
    compile group: 'org.grails', name: 'grails-plugin-controllers', version: '3.3.16'

}

bootRun {
    jvmArgs('-Dspring.output.ansi.enabled=always')
    addResources = true
    String springProfilesActive = 'spring.profiles.active'
    systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}

tasks.withType(Test) {
    systemProperty "geb.env", System.getProperty('geb.env')
    systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
    systemProperty "webdriver.chrome.driver", System.getProperty('webdriver.chrome.driver')
    systemProperty "webdriver.gecko.driver", System.getProperty('webdriver.gecko.driver')
}

assets {
    minifyJs = true
    minifyCss = true
}
wvmv3b1j

wvmv3b1j1#

maven { url "https://maven.repository.redhat.com/ga/"}
compile 'org.springframework:org.springframework.beans:2.5.6.SEC01'

试试这个

相关问题