在做gulimall商城项目时,启动renren-fast后台时报错,报错信息如下:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'scheduleJobController': Unsatisfied dependency expressed through field 'scheduleJobService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scheduleJobService': Invocation of init method failed; nested exception is io.renren.common.exception.RRException: 获取定时任务CronTrigger出现异常
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:116)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1422)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
原因分析:bean不能创建不能装载,问题一般在配置上
解决步骤:
1.检查 dao层 service层 controller层有没有加注解
2. 当dao层service层controller层注解完整,此时检查对应的包,是否添加进针对这些注解的包扫描中, 如果没有则加上(一般在spring的配置文件中检查)
3.检查对应的yml和properties文件,或者检查数据库sql是否正常执行
该问题解决办法:删除当前数据库的内容,重新执行sql文件