最近在使用spring jpa 的过程中经常遇到懒加载的错误:"` org.hibernate.LazyInitializationException: could not initialize proxy [xxxx#18] - no Session 通过查询资料,整理了一下常见的几种解决办法. 一.spring.jpa.open-in-view 配置 测试 dao 层或者 service 层时,会出现 no Session 的错误:访问 controller 时,又不会出现上面的错误.查询资
Spring Boot 自动引入jackson: 通过:Spring-Boot-starter-web Jackson自动配置 这里的configurations是读取的这里: 通过反射加载JacksonAutoConfiguration: public void configure(ObjectMapper objectMapper) { Assert.notNull(objectMapper, "ObjectMapper must not be null"); MultiValue
@Configuration public class PropertiesUtils implements EnvironmentAware { private int redisExpireTime; private boolean enabled; private int refreshTime; @Override public void setEnvironment(Environment environment) { //解析配置文件头 RelaxedPropertyResolver
注意:本 Spring Boot 系列文章基于 Spring Boot 版本 v2.1.1.RELEASE 进行学习分析,版本不同可能会有细微差别. 前言 Spring 框架选择使用了 JCL 作为默认日志输出.而 Spring Boot 默认选择了 SLF4J 结合 LogBack.那我们在项目中该使用哪种日志框架呢?在对于不同的第三方 jar 使用了不同的日志框架的时候,我们该怎么处理呢? 1. 日志框架介绍 日志对于应用程序的重要性不言而喻,不管是记录运行情况还是追踪线上问题,都离不开对日