spring bean 循环依赖问题,在本地环境可以,测试环境报循环依赖问题
摘要:spring 在某些情况下是存在这样的问题:https://github.com/spring-projects/spring-framework/issues/18879https://github.com/spring-projects/spring-framework/issues/24325
阅读全文
posted @
2021-05-13 14:54
快鸟
阅读(4105)
推荐(0) 编辑
Spring PropertySources 与 PropertySource
摘要:org.springframework.core.env.PropertySources 是多个 org.springframework.core.env.PropertySource 的集合,是 spring 管理和保存属性配置的关键接口。SpringBoot 在启动时,会通过 PropertyS
阅读全文
posted @
2020-07-27 09:03
快鸟
阅读(1638)
推荐(1) 编辑
Spring AOP & 切面表达式
摘要:SpringAOP 和 AspectJ 的关系:它们是两种不同的编程风格, SpringAOP 使用 xml 配置的形式配置 aop。而 AspectJ 使用 AspectJ 的注解来配置 aop aspect、JoinPoint、Pointcut、Weaving、AdviceJoinPoint:
阅读全文
posted @
2020-02-05 17:54
快鸟
阅读(1862)
推荐(1) 编辑
Spring 配置项解析: @Value vs @ConfigurationProperties
摘要:@ConfigurationProperties vs @Value https://docs.spring.io/spring-boot/docs/2.2.2.RELEASE/reference/htmlsingle/#boot-features-external-config-vs-value
阅读全文
posted @
2020-01-19 14:46
快鸟
阅读(1155)
推荐(0) 编辑
Spring Bean 的实例化过程
摘要:2020.7.27 bean 创建的三步走: org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory createBean() --> doCreateBean() 1. createBeanInsta
阅读全文
posted @
2020-01-06 16:30
快鸟
阅读(5528)
推荐(0) 编辑
Spring IOC 自动注入流程
摘要:Spring 注解方式自动注入是在 populateBean() 时来完成的。核心代码是通过 AutowiredAnnotationBeanPostProcessor、CommonAnnotationBeanPostProcessor 来处理的。 doCreateBean() 时有 3 步: 1 1
阅读全文
posted @
2019-12-31 19:02
快鸟
阅读(1233)
推荐(0) 编辑
Spring BeanFactory 初始化 和 Bean 生命周期
摘要:(version:spring-context-4.3.15.RELEASE) AbstractApplicationContext#refresh() beanFactory 实例化后,会向 beanFactory 注册 bean 的定义 BeanDefinition。最后 beanFactory
阅读全文
posted @
2019-08-29 18:01
快鸟
阅读(1163)
推荐(0) 编辑
给 Advice 传递参数
摘要:参数绑定是在下面这个方法中做的:org.springframework.aop.aspectj.AbstractAspectJAdvice#invokeAdviceMethod(JoinPoint jp, @Nullable JoinPointMatch jpMatch, @Nullable Obj
阅读全文
posted @
2019-01-25 11:15
快鸟
阅读(195)
推荐(0) 编辑
记一次 Spring 事务配置踩坑记
摘要:记一次 Spring 事务配置踩坑记 问题描述:(SpringBoot + MyBatisPlus) 业务逻辑伪代码如下。理论上,插入数据 t1 后,xxService.getXxx() 方法的查询条件会不满足,会查询不到数据。结果事与愿违,后一次的查询,居然查到了数据。 分析过程: 抛弃业务逻辑,
阅读全文
posted @
2018-11-16 18:06
快鸟
阅读(1952)
推荐(0) 编辑
Spring踩坑记录
摘要:1. Spring properties配置项不能解析问题 本地部分配置文件迁到disconf,希望disconf的配置文件交由spring托管。这样的话,原有代码中引用配置的地方就不用变(还是用${key}的方式)。 在disconf上找到了配置方式:http://disconf.readthed
阅读全文
posted @
2017-11-20 17:10
快鸟
阅读(823)
推荐(0) 编辑
Spring中可复用工具类&&特性记录&&技巧
摘要:Spring 里有用工具类: GenericTypeResolver 解析泛型类型。核心逻辑还是调用 ResolvableTypeResolvableType 解析泛型类型参数 1 interface Service2<N, M> {} 2 3 class ABService2 implements
阅读全文
posted @
2017-10-19 16:13
快鸟
阅读(741)
推荐(0) 编辑
Spring中的类型转换与数据绑定(PropertyEditor、ConversionService、Data Binding、Formatter)
摘要:Spring早期使用PropertyEditor进行Object与String的转换。到Spring 3后,Spring提供了统一的ConversionService API和强类型的Converter SPI,以实现转换逻辑。Spring容器使用该系统来绑定bean property values
阅读全文
posted @
2017-06-29 11:13
快鸟
阅读(956)
推荐(0) 编辑
SpEL、PropertyPlaceholderConfigurer与@Value、#{}、${}
摘要:概念 SpEL:Spring EL表达式 PropertyPlaceholderConfigurer:即org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.java。我们通常通过配置一个PropertyPlac
阅读全文
posted @
2017-06-28 14:19
快鸟
阅读(957)
推荐(0) 编辑
Spring父容器与子容器
摘要:在使用spring+springMVC的web工程中,我们一般会在web.xml中做如下配置: <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:application.xml<
阅读全文
posted @
2017-02-16 11:00
快鸟
阅读(6879)
推荐(2) 编辑
Spring bean 的加载过程和生命周期
摘要:【spring version : 4.1.6.RELEASE】 使用spring的项目中,一般都会在web.xml中配置ContextLoaderListener,它就是spring ioc 的入口 入口:ContextLoaderListener.contextInitialized(Servl
阅读全文
posted @
2017-02-15 17:31
快鸟
阅读(3290)
推荐(0) 编辑
Spring AOP 由浅入深
摘要:(分析基于Spring的版本:version = 4.1.6.RELEASE) SpringAOP 和 AspectJ 的关系:它们是两种不同的编程风格, SpringAOP 使用 xml 配置的形式配置 aop。而 AspectJ 使用 AspectJ 的注解来配置 aop aspect、Join
阅读全文
posted @
2016-06-08 19:15
快鸟
阅读(1165)
推荐(0) 编辑
BeanFactory vs ApplicationContext
摘要:<ref:https://techythought.wordpress.com/2013/01/12/92/>
阅读全文
posted @
2016-05-23 17:23
快鸟
阅读(183)
推荐(0) 编辑
Spring container vs SpringMVC container(webmvc container)
摘要:Difference between applicationContext.xml and spring-servlet.xml in Spring Framework Scenario 1 In client application (application is not web applicat
阅读全文
posted @
2016-05-05 11:34
快鸟
阅读(494)
推荐(0) 编辑
Spring @Service生成bean名称的规则
摘要:今天碰到一个问题,写了一个@Service的bean,类名大致为:BKYInfoServcie.java dubbo export服务的配置: <dubbo:service interface="com.xxx.XxxService" ref="bKYInfoServcie" /> 结果启动报错:找
阅读全文
posted @
2016-04-26 23:19
快鸟
阅读(30374)
推荐(8) 编辑
在Spring的bean中注入HttpServletRequest解密
摘要:我们可以在Spring的bean中轻松的注入HttpServletRequest,使用@Autowired HttpServletRequest request;就可以了。 但是,为什么我们可以直接这样用呢? 原因肯定是Spring在容器初始化的时候就将HttpServletRequest注册到了容
阅读全文
posted @
2016-03-30 10:27
快鸟
阅读(11565)
推荐(4) 编辑