SoFunction
Updated on 2025-03-08

Question about springcloud reporting an error UnsatisfiedDependencyException

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]                : Application run failed
 
: Error creating bean with name 'paymentController': Unsatisfied dependency expressed through field 'paymentService'; nested exception is : Error creating bean with name 'paymentServiceImpl': Unsatisfied dependency expressed through field 'paymentDao'; nested exception is : Error creating bean with name 'paymentDao' defined in file [/Users/caoliu/Idea-workspace/springcloud/springcloud-privoder-payment-8001/target/classes/org/fecker/springcloud/dao/]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is : Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/]: Bean instantiation via factory method failed; nested exception is : Failed to instantiate []: Factory method 'sqlSessionFactory' threw exception; nested exception is : Failed to parse mapping resource: 'file [/Users/caoliu/Idea-workspace/springcloud/springcloud-privoder-payment-8001/target/classes/mybatis/]'; nested exception is : Error parsing Mapper XML. Cause:
 at $(:643) ~[spring-beans-5.2.:5.2.]
 at (:130) ~[spring-beans-5.2.:5.2.]
 at (:399) ~[spring-beans-5.2.:5.2.]

: Error creating bean with name 'XXXXXX': Unsatisfied dependency expressed through

My error was caused by an error in the mapper-locations configuration in the file

mistake:

#1. Configure the mapper file in the mapper under resource
mapper-locations: classpath:mybatis/*.xml

correct:

#1. Configure the mapper file in the mapper under resource
mapper-locations: classpath:mybatis/

This is the article about the problem of springcloud reporting an error report UnsatisfiedDependencyException. For more related springcloud reporting an error, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!