SpringCloud GateWay custom filter GatewayFilter and AbstractGatewayFactory

1. GatewayFilter GatewayFilter is a simple interface used to define the behavior of a gateway filter. A gateway filter is a class that implements the GatewayFilter interface and can perform certain operations when a request enters the gateway or when a response leaves the gateway. Filters can be used to modify requests or responses, log, […]

Solving errors in web projects, java.io.FileNotFoundException: druid.properties (the system cannot find the specified file); [spring factory decoupling development]

When using Tomcat9.0, spring5.0 framework original factory class decoupling, druid-1.0.9jar version, JDK9, MSQL8 version database to simulate web page login case, an error message that the druid.properties file cannot be found appears, the details are as follows [Case code posted at the end]; Normally speaking, the configuration file is placed under the src directory, and […]

factory design pattern

Article directory 1. Simple Factory Pattern & Static Factory Pattern 2. Factory method pattern 3. Abstract Factory Pattern Illustrations from: https://refactoringguru.cn/design-patterns/catalog 1. Simple factory pattern & amp; static factory pattern Simple Factory Pattern Strictly speaking, it is not a design pattern, but more like a programming habit. The simple factory pattern does not expose the […]

Simple factory vs factory method

Factory method pattern – no need to know manufacturing details The simple factory pattern was introduced earlier. The simple factory pattern is just the most basic design pattern related to creating instances. In real situations, there are more complex situations to deal with. A class that generates instances from a simple factory knows too many […]

Mybatis integrates pagehelper and reports an error ClassNotFoundException: org.mybatis.logging.LoggerFactory

Table of Contents Report an error reason Solution Error report In order to introduce pagehelper, the following code is added to the pom.xml file <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1.1.3</version> </dependency> As a result, the error when starting the soringboot project is as follows: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘testMybatisController’: Unsatisfied dependency expressed through field ‘salePickGoodsInfoMapper’; […]

Spring Cloud Gateway Series: Routing Assertion Factory

Article directory 1. After routing assertion factory configuration API style 2. Before routing assertion factory configuration API style 3. Between routing assertion factory configuration API style 4. Cookie routing assertion factory configuration API style 5. Header routing assertion factory configuration API style 6. Host routing assertion factory configuration API style 7. Method routing assertion factory […]

If the new Feign interface is started according to the microservice, an error will be reported: org.springframework.beans.factory.UnsatisfiedDependencyException:

Startup error: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘jgEntInfoController’: Unsatisfied dependency expressed through field ‘remoteJgEntInfoService’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘ com.supervise.system.api.RemoteJgEntInfoService’: Unexpected exception during bean creation; nested exception is java.lang.IllegalStateException: No fallbackFactory instance of type class com.supervise.system.api.factory.RemoteJgEntInfoFallbackFactory found for feign client remoteJgEntInfoService question: rg.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean named ‘jgEntInfoController’: Dependency […]

jdbc data source (DruidDataSourceFactory) connection pool – druid

<dependencies> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.28</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.2.16</version> </dependency> </dependencies> 1. Druid data source connection pool technology package com.csdn.jdbc; import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.pool.DruidPooledConnection; import java.sql.SQLException; // Demonstrate data source connection pool druid Druid data source connection pool technology public class DataSourceConnectPool { public static void main(String[] args) throws SQLException { DruidDataSource dataSource […]

[Source code analysis] Spring source code interpretation-beanFactory and Bean’s post-processor process

In the previous article, we introduced in detail how spring successfully created beanfactory by loading the xml configuration file. Following the core process, we continue to talk about the post-processing process of beanFactory and Bean. //Template method left to subclasses, allowing subclasses to continue to perform some processing on the factory; Allows post-processing of the […]