- 博客(137)
- 资源 (3)
- 收藏
- 关注
原创 Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operat
是两表的排序规则不一致。
2023-11-14 15:36:14
1145
原创 Axios使用固定session发送http请求
今天使用Axios发送https请求时,发现session一直在变。因为后端需要在session存储一些信息,所以对这一需求更改前端。第二种方式是直接创建了一个otherHttp ,把参数配置到这里。因为使用了vben框架。初步测试,发现可行。
2023-11-10 11:01:33
964
原创 The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]
原因是HikariCP默认支持TLS1.2,也支持TLS1.3,但是就是不支持TLS1.0,因为太古老了,不安全。使用HikariCP连接sqlserver2008,结果报错了。结果是失败,启动失败。最后更换高版本sqlserver。尝试降低HikariCP版本。
2023-06-13 15:16:50
385
原创 Mybatis3源码全解析
Mybatis架构:图自:MyBatis整体架构_tiankong_12345的博客-优快云博客_mybatis架构Mybatis架构分三层:第一层:SqlSession这是使用mybatis的主要接口,通过这个接口我们可以执行命令,获取mapper或者管理事务。Through this interface you can execute commands, get mappers and manage transactions.第二层:核心处理层配置解析模块:myb
2022-05-14 15:14:32
1192
原创 SpringBoot事务原理解析
Spring中使用事务需要添加注解,表示开启事务@EnableTransactionManagement这个注解有个默认属性AdviceMode mode() default AdviceMode.PROXY;说明默认是使用JDK代理的通知模式。然后注解上面使用了@Import注解@Import(TransactionManagementConfigurationSelector.class)我们再来看TransactionManagementConfigurationSe
2022-04-16 14:17:51
2032
原创 Centos7替换默认openjdk
[root@VM_0_2_centos jdk1.8.0_281]# update-alternatives --display javajava - status is auto.link currently points to /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jre/bin/java/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jr.
2022-04-05 15:52:34
1820
原创 JDK动态代理源码解读
入口是java.lang.reflect.Proxy#newProxyInstance简化一下就三步://从缓存查找代理类,或者生成指定的代理类Class<?> cl = getProxyClass0(loader, intfs);//获取public构造器,如果不是public 设置为可访问final Constructor<?> cons = cl.getConstructor(constructorParams)//调用有参构造器创建实例cons.newI
2022-03-28 01:27:01
1055
原创 Java开发需要的官方文档
//Java虚拟机文档https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/// JavaSE 规范文档和JVM规范文档Java SE Specificationshttps://docs.oracle.com/javase/specs/index.html//Java api文.
2022-03-09 18:21:29
9496
原创 ElasticSearch启动报错RollingFileManager (/xxx/xxx) java.io.FileNotFoundException
ElasticSearch启动报错如下:2022-03-06 17:22:07,358 main ERROR RollingFileManager (/home/software/elasticsearch-7.17.1/logs/elasticsearch_server.json) java.io.FileNotFoundException: /home/software/elasticsearch-7.17.1/logs/elasticsearch_server.json (Permission
2022-03-06 21:09:49
5223
原创 Centos7.5安装Kibana7.17和Logstash7.17
安装Kibana:Past Releases of Elastic Stack Software | Elastic下载对应版本的Kibana,上传Linux服务器,解压/home/software/kibana-7.17/放开的配置如下server.port: 5601server.host: "0.0.0.0"server.publicBaseUrl: "http://122.51.53.xxx:5601"elasticsearch.hosts: ["http://localh.
2022-03-06 18:03:53
2998
原创 Centos7.5安装ElasticSearch7.17
// 查看各版本支持的JDK支持矩阵 | Elastic//官方参考安装文档Installing Elasticsearch | Elasticsearch Guide [8.0] | Elastic//安装包下载Past Releases of Elastic Stack Software | Elastic这里我的是CentOS7.5,可以用命令查看系统版本cat/etc/redhat-release我下载的不是最新的elasticsearch-7.17.1-l..
2022-03-04 17:20:14
2194
原创 RestTemplate调用服务报错java.net.UnknownHostException: EUREKA-SERVER
使用RestTemplate 来调用服务,配置类有 @Bean @LoadBalanced RestTemplate restTemplate() { return new RestTemplate(); }EUREKA-CLIENT调用EUREKA-SERVER报错如下。2022-03-02 18:04:36.801 ERROR 17956 --- [nio-8083-exec-7] o.a.c.c.C.[.[.[/].[dispatcherSe
2022-03-02 23:51:30
2718
原创 RabbitMQ接收消息时报错ConditionalRejectingErrorHandler : Execution of Rabbit message listener failed
Springboot整合RabbitMQ,启动不报错,收到消息就报错ConditionalRejectingErrorHandler : Execution of Rabbit message listener failed2022-02-23 18:57:59.718 WARN 24956 --- [ntContainer#0-1] s.a.r.l.ConditionalRejectingErrorHandler : Execution of Rabbit message listener f
2022-02-23 22:42:05
4529
原创 SpringBoot中的ServletContextListener接口实现类
Spring中ContextLoaderListener类实现了ServletContextListener接口可以看到有在SpringBoot中用来初始化WebApplicationContext。/** * Initialize the root web application context. */@Overridepublic void contextInitialized(ServletContextEvent event) { initWebApplicat...
2022-02-22 00:16:29
1766
原创 SpringBoot的actuator无法执行/refresh,报错404
微服务从配置中心获取配置,当远程仓库git的参数修改时,需要以post方式执行/actuator/refresh刷新配置。但是执行失败。报错404.{ "timestamp": "2022-02-21T02:46:35.030+00:00", "status": 404, "error": "Not Found", "message": "No message available", "path": "/actuator/refresh"}查看spring
2022-02-21 11:15:07
3777
原创 给配置中心添加security依赖后,微服务A访问报错Could not locate PropertySource
原本微服务客户端能正常从配置中心获取到配置,添加spring-boot-starter-security依赖后获取不到配置了<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId></dependency>报错如下:Could not locate
2022-02-20 17:18:18
996
原创 Integer和Long可以用==号比较值大小吗?
遇到问题,最好的办法是写个Test类测试一下,再看源码 @Test public void test() throws Exception { Integer a = 127; Integer b = 127; Integer c = new Integer(127); Integer d = new Integer("127"); Integer e = new Integer("127"); .
2021-11-18 17:50:07
2650
原创 用BeanCopier实现属性copy
偶然发现有个属性拷贝的类比较好用,比org.springframework.beans.BeanUtils性能好.先看用法:public static void main(String[] args) { PayUserThirdaccountVO payUserThirdaccount = new PayUserThirdaccountVO(); payUserThirdaccount.setId("1"); payUserThirdaccount.setThirdpaySyste
2021-11-12 23:47:20
1312
原创 Spring注解@Scheduled的属性介绍
何处使用: 必须标记在方法上,并且方法必须没有返回值,也就是必须是void方法.怎么使用:1.需要有@EnableScheduling注解,或者<task:annotation-driven/>配置2.@Scheduled必须指定三个属性cron(), fixedDelay(),fixedRate()其中之一cron属性:格式如"0 * * * * MON-FRI"分别表示 秒,分钟,小时,月份的某天,月份,星期fixedDelay属性:上一次执行结束与下一次开
2021-11-08 18:42:13
595
原创 HttpClientUtils 上传下载类(参考)
HttpClientUtils.javapackage com.rongsoft.common.util;import com.alibaba.fastjson.JSON;import com.alibaba.fastjson.JSONArray;import com.alibaba.fastjson.JSONObject;import org.apache.commons.compress.archivers.ArchiveEntry;import org.apache.commons.
2021-11-04 18:41:45
648
原创 代理模式在Jeesuite框架中的使用
上一篇解析Jeesuite框架中mybatis拦截器的使用讲到拦截器添加到了sqlSessionFactory的配置类sqlSessionFactory.getConfiguration().addInterceptor(interceptor)那么拦截器是何时执行以及如何生效的呢?这个实际上是添加到配置类Configuration的interceptorChain属性了interceptorChain.addInterceptor(interceptor);我们先来看这个拦截器接口..
2021-10-14 19:17:31
156
原创 解析Jeesuite框架中mybatis拦截器的使用
Jeesuite系列包含基础库、配置中心、统一认证平台、网关、快速开发平台五大部分(计划陆续开源)。提供灵活可靠的一站式解决方案、开箱即用。其中,Jeesuite基础库提供了数据库、缓存、消息中间件、分布式定时任务、云存储等基础模块。每个组件都可以独立使用,十分方便.下面我们来看看mybatis拦截器在Jeesuite框架中的使用.SpringBoot并没有为mybatis提供自动启动类,但是mybatis自己提供了<dependency> <groupId>or
2021-10-13 23:22:34
242
原创 IDEA中如何查看现有分支是基于哪个分支创建的?
通常情况都是在master分支上创建新的分支,开发完成后合并到master上.有的时候刚创建完新的分支,却不记得基于哪个分支创建的了.IDEA上比较容易查基于哪个分支.1.直接打开下方的"Terminal"栏,快捷键是ALT+F122.输入 git reflog --date=local3.Ctrl + F 查询现有版本4.找到 checkout: moving from feature/基于的分支to feature/新创建的分支类似这样的// 这里就是代表 "内容管理"分...
2021-08-26 14:59:38
16129
原创 Spring中@Scheduled注解生效和执行原理全解析
首先,使@Scheduled生效的注解是@EnableScheduling可以标注在配置类或者Application类上./ * @author Chris Beams * @author Juergen Hoeller * @since 3.1 * @see Scheduled * @see SchedulingConfiguration * @see SchedulingConfigurer * @see ScheduledTaskRegistrar * @see Trig
2021-06-25 19:11:15
2200
原创 SpringBoot整合EhCache
1.开启@EnableCaching2. <!--开启 cache 缓存 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-cache</artifactId> </dependency&
2021-05-28 19:15:24
247
原创 启动SpringBoot测试类报错Unable to find a @SpringBootConfiguration
启动测试用例报错了Unable to find a @SpringBootConfiguration, you need to use @ContextConfigura
2021-05-28 16:04:13
233
原创 flowable中的责任链模式示例
上一文讲到flowable使用了责任链模式执行命令LogInterceptor extends AbstractCommandInterceptorSpringTransactionInterceptor extends AbstractCommandInterceptorCommandContextInterceptor extends AbstractCommandInterceptorCommandInvoker extends AbstractCommandInterceptor..
2021-05-27 18:44:13
508
原创 flowable中命令模式的应用
flowable中大量使用了设计模式中的 命令模式,咱来看看源码.首先出场的执行器接口:CommandExecutor 只有一个实现类CommandExecutorImpl 负责执行所有的命令.执行器有个最重要的方法 /** * Execute a command with the default {@link CommandConfig}. */ <T> T execute(Command<T> command);这个执行器在创
2021-05-26 22:59:30
2156
原创 Bean转Map方法
// Bean --> Map 1: 利用Introspector和PropertyDescriptor 将Bean --> Mappublic static Map<String, Object> transBean2Map(Object obj) throws Exception { if (obj == null) { return null; } Map<String, Object> map = new HashMap<String.
2021-04-30 18:38:02
952
2
原创 后台导出文件
HttpServletResponse response ServletOutputStream out = null; try { response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ";filename*=utf-8''" + URLEncoder.encode(fileName, "UTF-8")); ..
2021-04-21 14:24:05
199
原创 list调用stream方法报错空指针异常
java.lang.NullPointerExceptionatjava.util.stream.Collectors.lambda$groupingBy$45(Collectors.java:907)atjava.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)atjava.util.ArrayList$ArrayListSpliterator.forEachRemain...
2021-03-26 18:38:16
6904
原创 Windows系统shardingsphere启动时报错找不到或无法加载主类问题
找不到或无法加载主类org.apache.shardingsphere.ui.Bootstrap原因:是某些加压包加压错误问题:解决方式:使用tar zxvf xxxxx命令解压tar zxvf shardingsphere5-ui-bin.tar
2021-03-16 10:19:56
1681
原创 tkMapper的andLike的使用
查询条件: where type='intf' and (code like '%keyword%' or name like '%keyword%')Example example = new Example(SysPermissionEntity.class);example.createCriteria().andEqualTo("type","intf").andLike("code","%"+keyword+"%");List<SysPermissionEntity> per.
2021-03-15 17:00:08
3075
原创 Spring AOP报错Set ‘exposeProxy‘ property on Advised to ‘true‘ to make it available问题
使用AopContext.currentProxy()时报错了.如下Cannot find current proxy: Set 'exposeProxy' property on Advised to 'true' to make it available,and ensure that AopContext.currentProxy() is invoked in the same thread as the AOP invocation context.看意思就是 没用设置exposePro..
2021-03-10 18:09:00
6884
原创 MySQL主从复制报错Authentication plugin ‘caching_sha2_password‘ reported error: Authentication
在从库上执行 show slave status\G显示报错:Last_IO_Error: error connecting to master 'repl@127.0.0.1:3316' - retry-time: 60 retries: 2 message: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.考虑到我的MySQL8 ,
2021-03-07 15:16:09
16494
7
原创 mybatis的mapper类报错Error:(60,54) java: 找不到符号
SysConfigEntity version = sysConfigMapper.findOneByCode(VERSION_KEY);sysConfigMapper这个标识报错"Error:(60,54) java: 找不到符号",clean之后还是maven 编译失败.往下查看,发现 mapper类与 xml的参数名不一致,修改后重新编译成功....
2021-03-03 10:53:30
3071
原创 SpringBoot的自动化配置原理
@SpringBootApplication所在包是org.springframework.boot:spring-boot-autoconfigure:1.5.22.RELEASE@SpringBootApplication有三个重要注解,其中有个@EnableAutoConfiguration注解,在@EnableAutoConfiguration注解上有一行@Import({AutoConfigurationImportSelector.class})而AutoConfiguratio.
2021-02-24 18:26:10
138
原创 MySQL中delete join 引发的危机
一开始是 执行查询操作,执行没问题,就改为删除操作DELETEFROM pay_recepit prJOIN fbank_account_notify fan ON fan.trade_no = pr.trade_noWHERE pr.create_time >=str_to_date('2020-01-08 11:00:00','%Y-%m-%d %H:%i:%s') AND fan.is_ent_deposit = 'Y';啪,打脸了,执行不了,报错You have an e.
2021-01-21 14:02:51
515
asmtools.jar
2020-07-21
Zookeeper_DistributeLock_Demo.zip
2020-06-28
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人