时间:2021-05-19
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-11-14 00:38:14.164 ERROR 1022 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'paymentController': Unsatisfied dependency expressed through field 'paymentService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'paymentServiceImpl': Unsatisfied dependency expressed through field 'paymentDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'paymentDao' defined in file [/Users/caoliu/Idea-workspace/springcloud/springcloud-privoder-payment-8001/target/classes/org/fecker/springcloud/dao/PaymentDao.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; 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 org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [/Users/caoliu/Idea-workspace/springcloud/springcloud-privoder-payment-8001/target/classes/mybatis/mybatis-config.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.NullPointerException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'XXXXXX': Unsatisfied dependency expressed through
我的报错是因为application.yml文件里mapper-locations配置报错
错误:
#1.配置mapper文件放在resource下的mapper中
mapper-locations: classpath:mybatis/*.xml
正确:
#1.配置mapper文件放在resource下的mapper中
mapper-locations: classpath:mybatis/mapper.xml
到此这篇关于关于springcloud报错报UnsatisfiedDependencyException的问题的文章就介绍到这了,更多相关springcloud报错内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
问题springboot集成springcloud时常常由于版本问题而报错,如下:com.sun.jersey.api.client.ClientHandler
初学编程遇到程序报错问题怎么解决?对于每一个编程初学者遇到头疼的问题就是程序报错。关于程序报错的话题大家都比较关心,遇到代码报错要掌握一定解决技巧。正确认识报错
springcloud中使用@Data标签,不用手动添加getset方法,但是如果项目中其他类中使用getset方法,如果报错,原因是idea中没有添加Lomb
今天在做项目的时候突然遇到一个问题:启动服务器的时候spring没报错,可是当我访问某个页面的时候spring报Requestbeaniscurrentlyin
背景:Springcloud项目使用Springcloud-config作为分布式配置,配置参数都放在config里,不同的环境有不同的问题:项目本地:boos