@attack666
2021-03-08T12:04:37.000000Z
字数 1407
阅读 643
问题:编译错误
关键提示信息:# Could not resolve placeholder '{img.dir}' in string value "${img.dir}
错误原因分析:application.properties中没有img.dir
修改方案:
目前不知道这个img.dir究竟是存放的什么,临时改成了runtime/upload文件夹的目录。即在application.properties中加入img.dir=C:/Users/DELL/Desktop/proj/runtime/upload
问题:编译错误
关键提示信息:
2021-3-8 19:27:11 [restartedMain] WARN[AnnotationConfigServletWebServerApplicationContext]:559Exception encountered during context initialization -cancelling refresh attempt:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'taskController'defined in file [C:\Users\DELL\Desktop\proj\beauty-o2o-api\target\classes\cn\enilu\flash\api\controller\system\TaskController.class]: Unsatisfied dependency expressedthrough constructor parameter 0; nested exception isorg.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'taskService':Bean with name 'taskService' has been injected into otherbeans [jobService] in its raw version as part of acircular reference, but has eventually been wrapped. This means that said other beans do not use the finalversion of the bean. This is often the result of over-eager type matching - consider using'getBeanNamesForType' with the 'allowEagerInit' flagturned off, for example.
错误原因分析:
文件1(/src/main/java/cn/enilu/flash/service/task/TaskService.java)中注入了文件2(/src/main/java/cn/enilu/flash/service/task/JobService.java),
文件2中注入了文件1。形成了循环依赖。
不过具体的原因还有待尚缺,因为有人认为SpringBoot中已经默认解决了循环依赖问题
临时解决方案
在@Autowired后添加@Lazy注解