# Solve Error creating bean with name dataSource defined in class path resource [applicationContext

Solution: Error creating bean with name dataSource’ defined in class path resource [applicationContext.xml] 1. The error log is as follows: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘dataSource’ defined in class path resource [applicationContext.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory. BeanCreationException: Error creating bean with name ‘org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0’: Initialization of bean failed; nested […]

springboot combines baomidou dynamic-datasource component to implement multiple data sources

When the amount of system data is too large, system performance problems gradually surface. Using the master-slave mode is a better choice. That is, the business is executed in the main database, and queries that do not affect the business are considered to go to the slave database. At this time, the program requires dynamic […]

Resolved Spring Error: Failed to configure a DataSource: url attribute is not specified and no embedded

Blogger Maotouhu () takes you to Go to New World? Blog homepage: Maotouhu’s blog “Complete Column of Interview Questions” Articles with pictures and texts Vivid images Simple and easy to learn! Everyone is welcome to step in~ “IDEA Development Cheats Column” Learn the common operations of IDEA and double your work efficiency~ “Master Golang in […]

sprintboot + mybatis plus + dynamic-datasource multiple data switching and ensure transaction consistency of multiple data sources

Foreword: This project is a single project and does not involve distributed transactions. The requirements are relatively straightforward. It is to query the data of two databases at the same time in one request method and insert data into the two databases. Ensure transaction consistency 1. Multiple data source dependencies <dependency> <groupId>com.baomidou</groupId> <artifactId>dynamic-datasource-spring-boot-starter</artifactId> <version>3.3.5</version> </dependency> […]

[mybatis-plus] Multiple data source switching [dynamic-datasource] Manually switch data sources

Springboot + mybatis-plus + dynamic-datasource + Druid manually switch data sources Article directory Springboot + mybatis-plus + dynamic-datasource + Druid manually switch data sources 0.Preface 1. Brief analysis of core classes of multiple data sources 1. 1. DynamicDataSourceContextHolder switches the data source core class 1.2. DynamicRoutingDataSource 2. Based on the understanding of core classes, we […]

[Backend]DynasticDataSource implements multi-data source configuration

Article directory 1. Usage scenarios 1.1 Complex business (large amount of data) 1.2 Separation of reading and writing 2. Configure a single data source 3. Configure multiple data sources 3.1 Using Datasource 3.1.1 First create a single data source configuration 3.1.2 Multiple data source configuration (rougher version) 3.2 Using AbstraceRoutingDataSource 3.2.1 Testing (solve problem 1) […]

springboot integrates mybatis-plus+dynamic-datasource to achieve separation of reading and writing

Step one, guide package The data source uses druid. The druid and mybatis-plus versions here are not the latest, so you can choose them yourself. <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> <version>1.1.10</version> </dependency> <dependency> <groupId>com.baomidou</groupId> <artifactId>dynamic-datasource-spring-boot-starter</artifactId> <version>3.1.0</version> </dependency> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>2.1.9</version> </dependency> Step 2, write configuration The SqlServer used in the database here can be modified by […]

Springboot+dynamic-datasource+Druid database configuration encryption

Springboot + mybatis-plus + dynamic-datasource + Druid database configuration encryption Article directory 0.Preface 1. Dynamically add and remove data sources 2.Basic introduction 3. Example of usage steps Simple way, use default encryption 1. Use the following tool to output the encrypted password 1. Configure the above encrypted password into the configuration file If the default […]

dynamic-datasource-spring-boot-starter for multiple data sources

demo structure java service BasicTestServiceImpl BasicTestServiceImpl resources mapper BotBasicTestMapper.xml BotKmsTestMapper.xml application.properties POM java service BasicTestServiceImpl @DS(value = CommonConstant.SMARTXMABASIC) @Service public class BasicTestServiceImpl implements BasicTestService {<!– –> @Autowired private BasicTestMapper basicTestMapper; @Override public List<Map<String, Object>> qureyEntityInfo() {<!– –> return basicTestMapper.selectInfo(); } } BasicTestServiceImpl @DS(value = CommonConstant.SMARTXMAKMS) @Service public class KmsEntityServiceImpl implements KmsEntityService {<!– –> @Autowired private […]

How does Spring Boot complete the Mysql operation through jdbc+HikariDataSource

Preface This blog post is about how Spring Boot completes the operation of Mysql through jdbc + HikariDataSource, I hope you like it Personal homepage: Chenxi Homepage Personal profile: Hello everyone, I am Chen Xi, I hope my articles can help everyone, your satisfaction is my motivation Welcome everyone: This is CSDN, where I summarize […]