Unsatisfied dependency expressed through bean property ‘sqlSessionTemplate‘;

 There is no problem with the code, but an error is reported when starting the operation

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: default
2023-10-25 16:59:38.210  INFO 228964 --- [           main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@3f91b517: startup date [Wed Oct 25 16:59:38 CST 2023]; root of context hierarchy
2023-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>()

The reason is that jdk is not configured correctly in the system configuration.

Configuration Guide

VScode runs Java - Jianshu

Press win+R and enter cmd

Enter java, it should be displayed as follows:

Enter javac, it should be displayed as follows:


 

Guess you like

Origin blog.csdn.net/weixin_40918145/article/details/134040067