最近在使用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
Xml 配置文件 日志 Spring Boot对各种日志框架都做了支持,我们可以通过配置来修改默认的日志的配置: #设置日志级别 logging.level.org.springframework=DEBUG 格式: logging.level.*= # Log levels severity mapping. For instance `logging.level.org.springframework=DEBUG` Spring Boot的自动配置的原理 Spring Boot在进行Spri