我正在尝试从this link创建一个调度程序作为指南。
我被卡住了,并收到此错误。
Message: org/springframework/core/log/LogDelegateFactory
Path Taken: new TransactionCheckerJob([Oauth2Template oauth2Template])
io.micronaut.context.exceptions.BeanInstantiationException: Error instantiating bean of type [bank.transaction.service.scheduler.TransactionCheckerJob]
Message: org/springframework/core/log/LogDelegateFactory
Path Taken: new TransactionCheckerJob([Oauth2Template oauth2Template])
我不知道这里出了什么问题。
我的源代码位于GITHUB
我正在使用micronaut 1.0.3
答案 0 :(得分:1)
您未包括错误消息的相关部分。当我运行您的应用程序时,我看到以下内容:
Message: org/springframework/core/log/LogDelegateFactory
Path Taken: new TransactionCheckerJob([Oauth2Template oauth2Template])
io.micronaut.context.exceptions.BeanInstantiationException: Error instantiating bean of type [bank.transaction.service.scheduler.TransactionCheckerJob]
Message: org/springframework/core/log/LogDelegateFactory
Path Taken: new TransactionCheckerJob([Oauth2Template oauth2Template])
at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:1345)
at io.micronaut.context.DefaultBeanContext.createAndRegisterSingleton(DefaultBeanContext.java:1914)
at io.micronaut.context.DefaultBeanContext.getBeanForDefinition(DefaultBeanContext.java:1635)
at io.micronaut.context.DefaultBeanContext.getBeanInternal(DefaultBeanContext.java:1615)
at io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:896)
at io.micronaut.context.AbstractBeanDefinition.getBeanForConstructorArgument(AbstractBeanDefinition.java:973)
at bank.transaction.service.scheduler.$TransactionCheckerJobDefinition.build(Unknown Source)
at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:1331)
at io.micronaut.context.DefaultBeanContext.createAndRegisterSingleton(DefaultBeanContext.java:1914)
at io.micronaut.context.DefaultBeanContext.getBeanForDefinition(DefaultBeanContext.java:1635)
at io.micronaut.context.DefaultBeanContext.getBeanInternal(DefaultBeanContext.java:1615)
at io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:507)
at io.micronaut.scheduling.processor.ScheduledMethodProcessor.lambda$process$5(ScheduledMethodProcessor.java:109)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org/springframework/core/log/LogDelegateFactory
at org.springframework.http.HttpLogging.forLog(HttpLogging.java:68)
at org.springframework.http.HttpLogging.forLogName(HttpLogging.java:57)
...
问题NoClassDefFoundError
。如果您对spring-core
添加依赖项,该错误将消失。