The error is as follows:

Error reason: jar package conflict.
Solution: clear the conflict or redundant jar package.
The error is as follows:

Error reason: jar package conflict.
Solution: clear the conflict or redundant jar package.
Recently, when I was learning spring cloud Alibaba, I needed sentinel for traffic management and control. When I configured the unified handling of returned exceptions, the implementation of urlblockhandler became popular. The reason is that I used sentinel 2.2.1.release, which was officially changed to blockexceptionhandler.
![]()


Solution: Inheritance BlockExceptionHandler The specific code is as follows:
package com.sentinel;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Component;
import com.Enum.RequestMsgEnum;
import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.BlockExceptionHandler;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.alibaba.csp.sentinel.slots.block.authority.AuthorityException;
import com.alibaba.csp.sentinel.slots.block.degrade.DegradeException;
import com.alibaba.csp.sentinel.slots.block.flow.FlowException;
import com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowException;
import com.alibaba.csp.sentinel.slots.system.SystemBlockException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.global.BaseController;
/**
* Custom sentinel exception return message
*/
@Component
public class MyUrlBlockHandler extends BaseController implements BlockExceptionHandler{
@Override
public void handle(HttpServletRequest request, HttpServletResponse response, BlockException ex) throws Exception {
String msg = null;
if (ex instanceof FlowException) {
msg = "Flow is restricted";
} else if (ex instanceof DegradeException) {
msg = "Degraded";
} else if (ex instanceof ParamFlowException) {
msg = "Hotspot parameter flow restriction";
} else if (ex instanceof SystemBlockException) {
msg = "System rule (load/... Not satisfied)";
} else if (ex instanceof AuthorityException) {
msg = "Authorization rule not passed";
}
// http status code
response.setStatus(500);
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Type", "application/json;charset=utf-8");
response.setContentType("application/json;charset=utf-8");
// spring mvc comes with a json manipulation tool called jackson
new ObjectMapper()
.writeValue(
response.getWriter(),
this.responseResult(RequestMsgEnum.Failtrue, msg)
);
}
}
Note: the basecontroller class is my own definition class. The custom format is returned to the front end and needs to be modified according to my own needs.
Phenomenon: the table cannot be opened and deleted
Solution:
>show full processlist; // List the processes, find the processes that are waiting, to kill them
......
......
>kill ID; // The ID number is the first column of "Id" listed

One of the important functions of gateway is routing and forwarding. We often encounter the problem of forwarding failure
for example, the front-end configuration is as follows:
// api interface request address
window.SITE_CONFIG['baseUrl'] = 'http://localhost:90/api';
The application.yml configuration of gateway is as follows:
server:
port: 90
spring:
application:
name: threat-gateway
cloud:
gateway:
routes:
# threat-ip microservice routing and forwarding
- id: ip_route
# The forwarding address of the matching route
uri: lb://threat-ip
predicates:
- Path=/api/cyber_threat_ip/**
filters:
- RewritePath=/api/(?<segment>.*),/$\{segment}
The reason for the error may be that the registry (such as Nacos) is not enabled, resulting in the unrecognized name of the microservice
it is revised as follows:
# Match the forwarding address of the route (8082 is the threat-ip microservice port)
uri: localhost:8082
As a result, an error was reported because http://, should be added in front of the URI, as follows:
# Match the forwarding address of the route (8082 is the threat-ip microservice port)
uri: http://localhost:8082
As a result, you can visit it

of course, the rewritepath path rewriting error in filters may also cause access error. Other reasons will be added later.
vue3.0+element-plus Added non-passive event listener to a scroll-blocking ‘mousewheel’ event. Consider marking event…
Solution:
Upgrade element-plus to the latest version. cnpm install [email protected] --save
Modify project space code
File-> Settings-> Editor-> File encodings
check the bottom box

Modifying the relevant configuration in Tomcat
Step 1: modify Tomcat configuration file and add UTF-8 code
Change the service.xml configuration in Tomcat's conf folder to add URIEncoding="UTF-8", as follows.
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8"/>
It was found that the start-up condition remained unchanged
Step 2: change the idea configuration and set the encoding to UTF-8
Refer to the above method
Step 3: modify the parameters in logging. Properties under conf of Tomcat
Change java.util.logging.ConsoleHandler.encoding = GBK
to
java.util.logging.ConsoleHandler.encoding = UTF-8
MySQL 5.7 has always been used before, because some changes have taken place after updating to MySQL 8.0, and some information needs to be modified in the configuration of MySQL driver connection.
In MySQL version 5.7, getting the database connection is realized by the following code
connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/数据库名称","数据库账号","数据库密码");
In MySQL 8.0, you need to add a time zone. The implementation code is as follows
connection = DriverManager.getConnection(” jdbc:mysql :// localhost:3306/ Database name true & amp; characterEncoding=utf-8&& amp; serverTimezone=GMT%2B8& Usessl = false “,” database account “,” database password “);
After completing the above modification, you can perfectly solve the connection problem of mysql8.0. The connection is successful, as shown in the figure below

Problem: in the lower version of Android phones, the use of window.location.txt jump is invalid
Analysis: add a time stamp after the jump link. Considering that the cache problem may exist in the low version, we add a dynamic parameter time stamp after the jump link to refresh the cache data
// Add a timestamp after the jump link, because considering that it is a low version there may be caching problems so use the dynamic parameter timestamp after the jump link to refresh the cached data
window.location.href = url+'?time='+((new Date()).getTime());
Analysis: after using the above method, there will still be some problems with the jump of some models. Another method is tried to change the jump mode into asynchronous mode, and use a delayer to simulate (it is recommended that the time should be less than 300ms, otherwise users will be able to perceive some of the phenomenon of stuck)
// After using the above approach, there will still be some models have problems jumping, and tried another way to jump into an asynchronous way, using a time delay to simulate (recommended time less than 300ms, or the user will be able to perceive a slight lag phenomenon)
setTimeout(() => {
window.location.href = url+'?time='+((new Date()).getTime());
}, 300);
Plug in: com.kit.cordova.amaplocation
https://www.jianshu.com/p/85aceaee3b35
When referring to the above link articles or other articles, we still can’t solve the key error of Gaode
running the following two commands may solve the long-standing problem
cordova platform remove "platformName" // Remove the project platform
cordova platform add "platformName" // add device platform
Example:
cordova platform remove android // Remove Android project platform
cordova platform add android // add android device platform
Navicate premium, ora-12514: TNS: listener does not currently know of service requested in connect descriptor
Ora-12514: TNS: listener does not currently know of service requested in connect descriptor

many methods on the Internet are to modify tnsnames.ora and listener.ora files, but the results are useless check the tnsnames.ora file and find that the service name is orcl.localdomain instead of orcl by default. Login successfully after modification


Can I convert Java objects to jsonnode objects directly
the only way to solve this problem is to convert the Java object to string and then to jsonnode
ObjectMapper mapper = new ObjectMapper();
//Method 1
String json = mapper.writeValueAsString(Java Object);
JsonNode jsonNode = mapper.readTree(json);
//Method 2
JsonNode jsonNode = mapper.valueToTree(Java Object);
//Method 3
JsonNode jsonNode = mapper.convertValue(Java Object, JsonNode.class);
Examples
/**
* Converting Java objects to JsonNode in Jackson
*
* @param object
* @return
*/
public static JsonNode getJsonNode(Object object) {
ObjectMapper mapper = new ObjectMapper();
return mapper.convertValue(object, JsonNode.class);
}
This bug appears when editing code with Hal Library of STM32. Right click to locate the relevant header file, but the system still reports an error. In fact, the main problem is the header file.
1. It is necessary to check whether the part used by the main program in the header file has been enabled, especially “stm32f1xx”_ hal_ “Con. H” and “stm32f1xx”_ hal.h”。
2. The compiler error is not accurate, such as the header file stm32f1xx_ Hal in RCC. H_ Statustypedef is not defined. You need to check carefully. The error is reported when compiling the. C file. Basically, they are all written by themselves. This kind of error will be reported only when there is an error in the compilation of the. C file. We need to pay attention to the unified include “ stm32f7xx_ hal.h>”, Instead of a separate include “stm32f7xx”_ hal_ gpio.h>” stm32f1xx_ hal_ (such as XXX. H header file)