我们正在使用spring boot 1.4.0.RELEASE将grails版本3.0.9升级到3.1.10,当我尝试编译时,我收到此错误:
Failed to instantiate [ch.qos.logback.classic.LoggerContext]
Reported exception:
java.lang.NoSuchMethodError: ch.qos.logback.core.util.Loader.getResourceOccurrenceCount(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/util/Set;
at ch.qos.logback.classic.util.ContextInitializer.multiplicityWarning(ContextInitializer.java:173)
at ch.qos.logback.classic.util.ContextInitializer.statusOnResourceSearch(ContextInitializer.java:196)
at ch.qos.logback.classic.util.ContextInitializer.getResource(ContextInitializer.java:143)
at ch.qos.logback.classic.util.ContextInitializer.findURLOfDefaultConfigurationFile(ContextInitializer.java:127)
at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:140)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:119)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:328)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:280)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:290)
at org.apache.commons.logging.LogFactory$getLog.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at ciab.base.Application.<clinit>(Application.groovy)
Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationContextInitializer : org.springframework.boot.autoconfigure.SharedMetadataReaderFactoryContextInitializer
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:412)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:392)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:383)
at org.springframework.boot.SpringApplication.initialize(SpringApplication.java:261)
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:237)
at grails.boot.GrailsApp.<init>(GrailsApp.groovy)
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:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
Caused by: java.lang.NoSuchMethodException: org.springframework.boot.autoconfigure.SharedMetadataReaderFactoryContextInitializer.<init>()
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.getConstructor(Class.java:1825)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlClassGetConstructor(ReflectiveInterceptor.java:524)
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:407)
... 12 more
知道出了什么问题,我试图排除logback-core但没有运气。如有任何疑问,请通知我。
由于 斯
答案 0 :(得分:0)
Grails 3.1.x与Spring Boot 1.3.x兼容
要使用Spring Boot 1.4.x,您需要使用即将发布的Grails 3.2.x,但在撰写本文时处于里程碑阶段。