0

我正在尝试将我的 grails 应用程序升级到 Grails 4.0.3。对于 REST 请求,我正在尝试使用micronaut-http-clientplugin -> build.gradle

dependencies {
    compile 'io.micronaut:micronaut-http-client:2.0.0'
}

不幸的是,当我使用grails run-app此堆栈跟踪运行应用程序时出现:

2020-06-30 15:05:50.260 ERROR --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed

io.micronaut.context.exceptions.BeanContextException: Error loading bean [io.micronaut.http.client.loadbalance.LoadBalancerConverters]: io/micronaut/inject/annotation/AnnotationMetadataHierarchy
    at io.micronaut.context.DefaultBeanContext.lambda$findBeanCandidates$32(DefaultBeanContext.java:1419)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
    at io.micronaut.context.DefaultBeanContext.findBeanCandidates(DefaultBeanContext.java:1429)
    at io.micronaut.context.DefaultApplicationContext.findBeanCandidates(DefaultApplicationContext.java:241)
    at io.micronaut.context.DefaultBeanContext.lambda$findBeanCandidatesInternal$68(DefaultBeanContext.java:2473)
    at io.micronaut.core.util.clhm.ConcurrentLinkedHashMap.lambda$compute$0(ConcurrentLinkedHashMap.java:721)
    at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
    at io.micronaut.core.util.clhm.ConcurrentLinkedHashMap.compute(ConcurrentLinkedHashMap.java:733)
    at io.micronaut.core.util.clhm.ConcurrentLinkedHashMap.computeIfAbsent(ConcurrentLinkedHashMap.java:710)
    at io.micronaut.context.DefaultBeanContext.findBeanCandidatesInternal(DefaultBeanContext.java:2473)
    at io.micronaut.context.DefaultBeanContext.getBeansOfTypeInternal(DefaultBeanContext.java:2511)
    at io.micronaut.context.DefaultBeanContext.getBeansOfType(DefaultBeanContext.java:894)
    at io.micronaut.context.DefaultBeanContext.getBeansOfType(DefaultBeanContext.java:620)
    at io.micronaut.context.DefaultApplicationContext.initializeTypeConverters(DefaultApplicationContext.java:428)
    at io.micronaut.context.DefaultApplicationContext.initializeContext(DefaultApplicationContext.java:235)
    at io.micronaut.context.DefaultBeanContext.readAllBeanDefinitionClasses(DefaultBeanContext.java:2446)
    at io.micronaut.context.DefaultBeanContext.start(DefaultBeanContext.java:200)
    at io.micronaut.context.DefaultApplicationContext.start(DefaultApplicationContext.java:187)
    at grails.boot.GrailsApp.createApplicationContext(GrailsApp.groovy:155)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:96)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:456)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:443)
    at example.Application.main(Application.groovy:11)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.NoClassDefFoundError: io/micronaut/inject/annotation/AnnotationMetadataHierarchy
    at io.micronaut.http.client.loadbalance.$LoadBalancerConvertersDefinition.<init>(Unknown Source)
    at io.micronaut.http.client.loadbalance.$LoadBalancerConvertersDefinitionClass.load(Unknown Source)
    at io.micronaut.context.AbstractBeanDefinitionReference.load(AbstractBeanDefinitionReference.java:63)
    at io.micronaut.context.DefaultBeanContext.lambda$findBeanCandidates$32(DefaultBeanContext.java:1417)
    ... 35 common frames omitted
Caused by: java.lang.ClassNotFoundException: io.micronaut.inject.annotation.AnnotationMetadataHierarchy
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    ... 39 common frames omitted


Process finished with exit code 130 (interrupted by signal 2: SIGINT)

我做了我的研究,但无法找到解决方案。

任何帮助,将不胜感激。先谢谢了~

4

1 回答 1

0

谢谢@erichelgeson。解决方案是完全删除该版本。这样它安装了 1.2.11 版本:

    compile 'io.micronaut:micronaut-http-client'
于 2020-07-01T09:41:06.737 回答