Unsatisfied dependency expressed through field ‘peopleInfosService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘peopleInfosServiceImpl’: Unsatisfied dependency expressed through field ‘peopleInfosDao’;
启动文件添加扫描的包 @MapperScan("com.sb.dao") 完整 @SpringBootApplication @MapperScan("com.sb.dao") @EnableCaching public class SbUsageApplication{ public static void main(String[] args){ SpringApplication.run(SbUsageApplication.class, args); } }启动文件配置servlet
public class SbUsageApplication extends SpringBootServletInitializer{ @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application){ return application.sources(SbUsageApplication.class); } public static void main(String[] args){ SpringApplication.run(SbUsageApplication.class, args); } }其中,addResourceHandler为路由URI,addResourceLocations为静态资源路径path,可配置多个路径.
http://localhost:8090/index.htmlFailed to load property source from location ‘classpath:/application.yml’: duplicate key
原因 yml文件格式错误,使用了tab进行缩进.解决 tab缩进改为空格缩进.但是使用ComponentScan会导致接口请求错误404.
情况1 将bean与启动类放在同级文件夹下,war包可正常提供web服务,jar仍出现404.情况2 将bean和component与启动类放在同级文件夹下,jar包正常提供web服务,war包404报错.总结 jar包和war包对组件位置要求不同.Type definition error: [simple type, class org.apache.ibatis.executor.loader.javassist.Javassist
原因 序列化及反序列化失败.解决 实例类上添加@JsonIgnoreProperties(value={“handler”}) import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @JsonIgnoreProperties(value={"handler"})Establishing SSL connection without server’s identity verification is not recommended.
原因方案 添加userSSL=false配置 jdbc.url=jdbc:mysql://localhost:3306/study?useUnicode=true&characterEncoding=utf8&useSSL=false【参考文献】 [1]https://blog.csdn.net/hz_940611/article/details/80771832 [2]https://blog.csdn.net/yy290879584/article/details/83419244 [3]https://www.cnblogs.com/a-xu/p/10027643.html [4]https://blog.csdn.net/Eggppp/article/details/84877921 [5]https://blog.csdn.net/zj7321/article/details/83240475 [6]https://blog.csdn.net/en_joker/article/details/87358573 [7]https://www.cnblogs.com/javajiuyangzhenjing/p/10210646.html [8]https://blog.csdn.net/qq_39597203/article/details/79939027 [9]https://blog.csdn.net/wgp15732622312/article/details/79951977
