欢迎来到飞鸟慕鱼博客,开始您的技术之旅!
当前位置: 首页知识笔记正文

Unsatisfied dependency expressed through bean property ‘sqlSessionTemplate‘;

墨初 知识笔记 133阅读

 代码没有问题但是启动运行报错

2023-10-25 16:59:38.165  INFO 228964 --- [           main] c.h.h.HailiaowenanApplication            : Starting HailiaowenanApplication on ganluhua with PID 228964 (D:\ganluhua\code\java\hailiao-java\target\classes started by 80913 in D:\ganluhua\code\java\hailiao-java)2023-10-25 16:59:38.166  INFO 228964 --- [           main] c.h.h.HailiaowenanApplication            : No active profile set, falling back to default profiles: default2023-10-25 16:59:38.210  INFO 228964 --- [           main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext3f91b517: startup date [Wed Oct 25 16:59:38 CST 2023]; root of context hierarchy2023-10-25 16:59:39.015  INFO 228964 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!2023-10-25 16:59:39.207  WARN 228964 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Bean creation exception on non-lazy FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name wxOrderMapper defined in file [D:\ganluhua\code\java\hailiao-java\target\classes\com\hi\hailiaowenan\wxpay\mapper\WxOrderMapper.class]: Unsatisfied dependency expressed through bean property sqlSessionTemplate; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration]: No default constructor found; nested exception instantiate java.lang.NoSuchMethodException: org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration.<init>()

原因jdk没有在系统配置中配置正确

配置指引

VScode 运行Java - 简书

按住winR,输入cmd

输入java应为如下显示

输入javac应为如下显示


 

标签:
声明:无特别说明,转载请标明本文来源!