As mentioned in the Spring startup process article, the initialization of the container starts with the refresh method, which calls the finishBeanFactoryInitialization method during the initialization process. In this method, the DefaultListableBeanFactory#preInstantiateSingletons method will be called. The core function of this method is to initialize non-lazy-loaded beans, and provides two extension points. The source code […]
Tag: spring
redis org.springframework.data.redis.RedisSystemException: Error in execution
Background When running a certain system, the test class stores a certain value into redis and then takes it out. 1. Problems encountered Error reported: org.springframework.data.redis.RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify […]
Springboot2.x integrated lettuce connection redis cluster reports timeout exception Command timed out after 6 second(s)
Original/Zhu Jiqian Background: Recently, I was doing a stress test on a newly developed Springboot system. I found that when I first started the stress test, I could access data from the redis cluster normally. However, after a few minutes of pause, and then when I continued to use jmeter to perform the stress test, […]
Spring transactions and distributed transactions
1. Specific definition of transactions Transactions provide a mechanism to incorporate all operations involved in an activity into an indivisible execution unit. All operations that make up a transaction can only be submitted if all operations can be executed normally. As long as any one of the operations fails to execute (an exception occurs) ), […]
spring boot validation use
spring-boot-starter-validation is a module used in Spring Boot to support data validation. It is built on the Java Validation API (JSR-380) and provides a convenient way to validate data in applications. Here is the basic way to use spring-boot-starter-validation: Quick Start 1. Add dependencies: In your Spring Boot project’s pom.xml file, add the following dependencies: […]
Spring-Spring’s circular dependency source code analysis
What is circular dependency? It’s very simple, that is, object A depends on object B, and object B depends on object A. for example: //A depends on B class A{ public B b; } // B depends on A class B{ public A a; } So are circular dependencies a problem? If you don’t consider […]
Spring MVC and AJAX integration example
Table of Contents 1. Introduction SpringMVC AJAX 2. Environment settings & related configurations 3. Create Spring MVC project 4. Create Controller 5. Front-end page design 6. Display data: 1. Introduction Spring MVC Spring MVC is a module in the Spring framework for developing web applications based on the Model-View-Controller (MVC) architecture. It provides a flexible […]
Spring-Anotion-(Spring configures beans based on annotations)
1. Basic introduction and introductory cases of Spring’s annotation-based bean configuration 1. Basic introduction: Configure beans based on annotations, mainly components in project development, such as Action, Service, and Dao. 2. Commonly used component annotation forms are: @Component indicates that the current annotation identifies a component. @Controller indicates that the current annotation identifies a controller, […]
Spring transaction @EnableTransactionManagement
Foreword @EnableTransactionManagement is an annotation provided by the Spring framework to enable annotation-based transaction management. By using this annotation, you can enable Spring’s automatic management of transactions, allowing you to use the @Transactional annotation on methods to declare transactions. @EnableTransactionManagement mainly has the following two attributes: mode (default is AdviceMode.PROXY): Specifies the mode of the […]
SpringBoot application starts org.apache.catalina.LifecycleException
Table of Contents SpringBoot application starts org.apache.catalina.LifecycleException Problem Description Cause Analysis Solution 1. Check the resources that the application depends on 2. Check application configuration 3. Check port occupancy 4. Check dependent component version compatibility 5. Check the log files Application scenario example: org.apache.catalina.LifecycleExceptionexception caused by database connection exception SpringBoot application starts org.apache.catalina.LifecycleException When developing […]