idea用Run启动项目正常,用DEBUG 或 热部署插件 启动就循环依赖

idea用Run启动项目正常,用DEBUG 或 热部署插件 启动就循环依赖,第1张

请求的bean当前正在创建:是否存在不可解析的循环引用?

贴一下报错信息:

Bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'WTCarNumRecognizerLibrary' defined in file [..\thzk\devices\WTCarNumRecognizerLibrary.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed;

 nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.StackOverflowError; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource 

[org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.StackOverflowError

 

最近公司新开发了一个硬件 引入SDK和Jar包后 热部署插件就没法用了 只能用Run启动了 导致改代码很麻烦 困扰了我一个月,今天无意间终于解决了!!!

先说一下我的解决步骤 :

我先把报循环依赖的类都查了一遍 看看哪里有没有循环引用 但我那只是一个接口 调用dll文件实现的接口 实现压根就不在我的代码里 所以排除掉!

接着我尝试把类注掉 发现能解决 不报错了 但是注掉也不行啊 项目要用的啊!!!

今天无意间看见一篇文章说分配内存!

链接:(15条消息) idea中 项目run启动正常,debug启动一直失败_bang,bang,bang的博客-CSDN博客_idea 启动debug失败https://blog.csdn.net/qq_40342026/article/details/113398564

于是我就尝试了一下 解决了我困扰许久的问题 现在debug和热部署插件都可以用了!!!

但是我仍然不明白为什么会导致出现循环依赖的报错,希望有大佬能解释一下!!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/788943.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-05
下一篇 2022-05-05

发表评论

登录后才能评论

评论列表(0条)

保存