springboot报错:Java Error creating bean with name:Bean with name has been injected into other beans…

全能 AI 聚合平台 免费

一站式接入主流 AI 大模型,支持对话 · 生图 · 生视频,即开即用

ChatGPT Claude Gemini Grok DeepSeek 通义千问 Ollama
AI对话 AI生图 AI视频
免费使用 →

问题描述:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name overTimeRemainTask : Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name taskService : Bean with name taskService has been injected into other beans [submitTestService] in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching – consider using getBeanNamesForType with the allowEagerInit flag turned off, for example
问题分析:两个service相互装配对方的实例,出现循环引用的情况,导致报错。

springboot报错:Java Error creating bean with name:Bean with name has been injected into other beans...

springboot报错:Java Error creating bean with name:Bean with name has been injected into other beans...

解决方法:
去掉其中一个service的@resource注解和service变量,解决相互嵌套引用即可。

© 版权声明

相关文章

暂无评论

none
暂无评论...