我正在尝试使用 JDK 11 和 Micronaut 1.0.2 运行此https://github.com/alvarosanchez/micronaut-workshop micronaut 研讨会示例
更新了一些依赖,它的编译很好。当我运行它的抛出错误时。
21:27:18.607 [main] ERROR io.micronaut.runtime.Micronaut - Error starting Micronaut server: Failed to inject value for parameter [objectMapper] of class: io.micronaut
.jackson.convert.ArrayNodeToArrayConverter
Path Taken: new ArrayNodeToArrayConverter([ObjectMapper objectMapper])
io.micronaut.context.exceptions.DependencyInjectionException: Failed to inject value for parameter [objectMapper] of class: io.micronaut.jackson.convert.ArrayNodeToAr
rayConverter
Path Taken: new ArrayNodeToArrayConverter([ObjectMapper objectMapper])
at io.micronaut.context.AbstractBeanDefinition.getBeanForConstructorArgument(AbstractBeanDefinition.java:981)
at io.micronaut.jackson.convert.$ArrayNodeToArrayConverterDefinition.build(Unknown Source)
at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:1329)
at io.micronaut.context.DefaultBeanContext.addCandidateToList(DefaultBeanContext.java:2237)
at io.micronaut.context.DefaultBeanContext.getBeansOfTypeInternal(DefaultBeanContext.java:2165)
at io.micronaut.context.DefaultBeanContext.getBeansOfType(DefaultBeanContext.java:752)
at io.micronaut.context.DefaultBeanContext.getBeansOfType(DefaultBeanContext.java:522)
at io.micronaut.context.DefaultBeanContext.getBeanRegistrations(DefaultBeanContext.java:313)
at io.micronaut.context.DefaultApplicationContext.initializeTypeConverters(DefaultApplicationContext.java:339)
at io.micronaut.context.DefaultApplicationContext.initializeContext(DefaultApplicationContext.java:193)
at io.micronaut.context.DefaultBeanContext.readAllBeanDefinitionClasses(DefaultBeanContext.java:2033)
at io.micronaut.context.DefaultBeanContext.start(DefaultBeanContext.java:156)
at io.micronaut.context.DefaultApplicationContext.start(DefaultApplicationContext.java:141)
at io.micronaut.runtime.Micronaut.start(Micronaut.java:67)
at io.micronaut.runtime.Micronaut.run(Micronaut.java:271)
at io.micronaut.runtime.Micronaut.run(Micronaut.java:257)
at io.micronaut.runtime.Micronaut$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:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:135)
at clubs.Application.main(Application.groovy:8)
Caused by: io.micronaut.context.exceptions.BeanInstantiationException: Error instantiating bean of type [io.micronaut.jackson.convert.ArrayNodeToArrayConverter]
Message: Multiple possible bean candidates found: [io.micronaut.jackson.ObjectMapperFactory, io.micronaut.jackson.ObjectMapperFactory]
Path Taken: new ArrayNodeToArrayConverter([ObjectMapper objectMapper])
at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:1343)
我的代码在这里https://github.com/sfgroups/micronaut-codes/tree/master/micronaut-workshop-ex02
如何修复此运行时错误?
谢谢