![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JAVA
文章平均质量分 75
YY大师
这个作者很懒,什么都没留下…
展开
-
Java数字类型转byte数组
【代码】Java数字类型转byte数组。原创 2022-10-25 16:30:00 · 2186 阅读 · 0 评论 -
The bean ‘dataTokenMapper‘ could not be injected because it is a JDK dynamic
The bean 'dataTokenMapper' could not be injected because it is a JDK dynamic proxy原创 2022-07-29 11:56:52 · 2444 阅读 · 0 评论 -
使用nginx对grpc进行反向代理和负载均衡
前言最近项目中需要给我们的grpc服务进行反向代理和负载均衡。故将这期间查阅的资料进行了整理记录相关链接介绍nginx负载均衡:https://blog.csdn.net/qq_51574197/article/details/117408823nginx对grpc进行反向代理:https://blog.csdn.net/Dearmark/article/details/80066819netty中http2的设计:https://my.oschina.net/u/1261452/blog/299原创 2022-05-30 17:38:15 · 5364 阅读 · 4 评论 -
spring配置文件中数据库配置serverTimeZone设置的作用
serverTimeZone设置的作用:就是告诉web应用,数据库服务的时区是什么。如果不在application配置文件中设置serverTimeZone的话,那么会在第一次连接数据库的时候,获取数据库设置的serverTimeZone,如果数据库没有设置serverTimeZone则数据库会报错1.创建数据库连接时jdbc会先尝试和数据库创建链接,创建链接之后,数据库会返回数据库的system_time_zone和time_zone设置,然后去取jdbc url中的serverTimezone配置原创 2022-04-25 22:55:47 · 4042 阅读 · 0 评论 -
记一次JAVA问题排查:查询出来的LocalDateTime类型时间不受serverTimezone影响
前提服务器所在时区UTC+8,配置文件中设置serverTimezone=UTC1.字段createtime是LocalDateTime类型现在服务器时间是**18:00**,使用**LocalDateTime=18:00**插入到数据库还是**18:00**查询数据,服务器使用LocalDateTime查出来还是**18:00**按道理说,服务器时间和数据库时间应该会不同的,因为服务器时区和serverTimezone的时区是不一样的,但是很明显LocalDateTime类型的数据不受se原创 2022-04-25 22:55:16 · 2577 阅读 · 0 评论 -
jdbc源码调试之查看jdbc对LocalDateTime和Date类型的处理
前提相信很多人在知道serverTimezone参数的设置之后,都会想知道jdbc在我们查询和插入时间类型数据的时候都时怎么进行处理的。下面就以查询来调试跟踪一下jdbc源码看看当前jdbc依赖的版本和mybatis依赖的版本<dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.5.7</versi原创 2022-04-25 22:54:36 · 2522 阅读 · 0 评论 -
记一次JAVA项目https证书过期-------访问项目的时候,nginx返回:ERR_CERT_DATE_INVALID
1.访问项目的时候,nginx返回:ERR_CERT_DATE_INVALID猜测是配置在nginx的https证书过期了,所以打算自己生成一个新的证书首先查找资料,使用openssl制作https证书,相关链接:https://www.csdn.net/tags/Mtjakg0sODI5ODAtYmxvZwO0O0OO0O0O.html2.使用openssl制作证书2.1 生成私钥openssl genrsa -out private.key 2048genrsa: 表示使用rsa算法,o原创 2022-04-25 17:19:08 · 3398 阅读 · 0 评论 -
Java8 LocalDateTime 时间戳 Instant ZoneOffset
1.时间戳定义首先我们要先了解时间戳的定义,Unix时间戳(Unix timestamp),或称Unix时间(Unix time)、POSIX时间(POSIX time),是一种时间表示方式,定义为从格林威治时间1970年01月01日00时00分00秒(北京时间1970年01月01日08时00分00秒)起至现在的总秒数。即北京时间要比格林威治时间多8个小时unix时间戳是从1970年1月1日(UTC/GMT的午夜)开始所经过的秒数,不考虑闰秒。[1]Unix时间戳(英文为Unix epoch, Un原创 2021-07-29 12:21:53 · 5302 阅读 · 0 评论 -
python requests发送post请求到java springboot报错no String-argument constructor/factory method to deserializ
最近在学习python使用python requests包发送请求到java springboot服务,报错:Request processing failed; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot construct instance of com.platon.contract.dto.req.Arc721Min原创 2021-04-16 14:56:23 · 1371 阅读 · 0 评论 -
CompletableFuture中的thenRun和thenRunAsync方法
需求:我需要在做完第一件事情后返回结果A,再做第二件事情,第二件事情依赖结果A。代码编程: @Resource(name = "globalThreadPool") private ThreadPoolExecutor threadPoolExecutor; CompletableFuture.supplyAsync(() -> { 做第一件事情; return A; },threadPoolExecutor).thenRun(()->{ 做第二件原创 2021-04-14 13:50:46 · 8489 阅读 · 9 评论 -
No tests found for given includes: [xxx.xxx.testList](filter.includeTestsMatching)
运行单元测试的时候报错: No tests found for given includes: (filter.includeTestsMatching) 解决方案加上依赖:testImplementation(“org.springframework.boot:spring-boot-starter-test:${springbootVersion}”)原创 2021-04-07 11:38:47 · 6620 阅读 · 1 评论 -
由ClassNotFoundException和NoClassDefError到类加载过程的思考
由ClassNotFoundException和NoClassDefError到类加载过程的思考结论:以下是楼主的论证过程场景1:使用Class.forName()去加载不存在的A类。以下是NoClassDefError的场景场景1:B类的class文件不存在,NoClassDefErrorTest类去编译场景2:B类的class文件,NoClassDefErrorTest类去编译,编译成功后再将B类的class文件删除场景3:B类的class文件,NoClassDefErrorTest类去编译,编译成功后原创 2021-01-26 15:31:51 · 886 阅读 · 0 评论