![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JAVA-EE
文章平均质量分 64
Erato Rabbit
这个作者很懒,什么都没留下…
展开
-
spring.HttpMessageNotReadableException: JSON parse error
去网上一搜,全都在说没有是因为没有空参构造器 NoArgsConstructor。实际上这只是表面。有时候即使没有空参构造器也无所谓。上面情况的问题在于,@value 会给两个成员变量 member field 都加上 final.首先明确一下 java 基础知识点:如果 class 里只有两个 final 的成员变量 member field. 那 空参 和 全参 两个构造器是没法共存的。空参会警告告诉你给 member field 赋初值(其实不能叫初值,该叫‘永久值’),原创 2023-08-15 10:48:44 · 990 阅读 · 0 评论 -
微服务中 Seata “分支事务不回滚”问题的复盘
这个问题还是围绕 Seata 分布式事务处理中“全局事务的开启与处理”和“xid的产生与传递”这两个知识。从前一天下午发现这个问题,然后没处理掉。晚上十一点继续处理这个问题,折腾到第二天凌晨四点左右才处理和验证完成。其实一开始就进入了误区原创 2023-06-13 14:43:36 · 4331 阅读 · 0 评论 -
Maven - Explain in Detail
However, an aggregator project and a parent project are both POM projects, they are not one and the same and should not be confused. A POM project may be inherited from - but原创 2023-03-27 11:57:50 · 698 阅读 · 1 评论 -
Spring Caching
This guide walks you through the process of enabling caching on a Spring managed bean.You will build an application that enables caching on a simple book repository.First, you need to create a simple model for your book. The following listing (from ) shows原创 2023-03-27 11:48:47 · 400 阅读 · 0 评论 -
Redisson Integration with Spring frameworks
Redisson is a Redis Java client with features of In-Memory Data Grid. It provides more convenient and easiest way to work with Redis.Use Redis commands mapping table to find Redisson method for a particular Redis command.Based on Netty framework. Redis 3.0原创 2023-03-27 11:43:16 · 434 阅读 · 0 评论 -
Creating a Multi Module Spring Boot Project
If you do not want to use the spring-boot-starter-parent, you can still keep the benefit of the dependency management (but not the plugin management) by using an import scoped原创 2023-03-27 11:36:25 · 540 阅读 · 0 评论 -
RabbitMQ Explain in Detail
RabbitMQ is a message broker: it accepts and forwards messages.A queue. Although messages flow through RabbitMQ and your applications, they can only be stored inside a queue. A queue is only bound by the host’s memory & disk limits, it’s essentially a lar原创 2023-03-27 11:29:17 · 397 阅读 · 0 评论 -
Mybatis - Mapper XML Files
The Mapper XML files have only a few first class elements (in the order that they should be defined):The next sections will describe each of these elements in detail, starting with the statements themselves.This tells MyBatis to create a PreparedStatement原创 2023-03-27 11:26:10 · 417 阅读 · 0 评论 -
How to use JSR303 and spring-boot-starter-validation
Bean Validation 源于JSR-303 ,而 JSR303 是 Java EE 6 中的一项子规范。JSR349、JSR380 是其升级版,添加了一些新的特性。Oracle 公司传统艺能,一流公司定标准,它们只定义了一些校验注解(Constraint),如@Null@NotNull@Pattern],位于包下,只提供 规范standard/specification 不提供实现implementation。转载 2023-02-05 23:32:31 · 104 阅读 · 0 评论 -
Use EasyCode to generate CRUD code automatically
version> 会自动跟着 spring-boot-starter-parents 的 version 走。加 dependency。原创 2023-02-04 11:38:31 · 97 阅读 · 0 评论 -
No bean of type ‘dao.PmsAttrDao’ available: expected 1 bean as autowire candidate
是本质上的 XxxDaoImpl, 但头上又不能加 annotation.都是加在 class 即 XxxServiceImpl 头上的。只好用 org.mybatis:mybatis:3.5.4 里的。Spring boot web 的。加在 interface 头上没用。原创 2023-01-02 01:54:37 · 100 阅读 · 0 评论 -
spring-boot-starter-data-redis 远程主机强迫关闭了一个现有连接
spring-boot-starter-data-redis:2.5.6 连接, 连接池是默认的 lettuce.但用 GUI 客户端 Redis Desktop Manager, 可以成功连接。: java.io.IOException: 远程主机强迫关闭了一个现有的连接。配置类里去掉下面这部分。redis 版本 6.2.7。原创 2022-09-20 17:49:32 · 1226 阅读 · 0 评论 -
java 业务异常 writableStackTrace
业务异常并不需要堆栈信息。可通过将 writableStackTrace 设置为false提高性能。尽管和方法直接返回仍有差距,但为了代码更加整洁是值得的。其实,虽然时间上差了10多倍,但创建50万次仅需要500ms,大多数情况下 writableStackTrace=false。java 业务异常 writableStackTrace。...转载 2022-08-07 15:59:19 · 246 阅读 · 0 评论 -
异常统一处理 设计自定义RuntimeException
在每个公司的架构中,日志肯定是重点,以至于很多时候需要对日志进行优化!6.使用范例:校验邮箱是否合法(可以放到工具类util)以上,设计有需要改进的地方,欢迎探讨!3.业务异常信息枚举。4.业务执行捕获异常。...转载 2022-08-07 15:48:04 · 838 阅读 · 0 评论 -
Spring 的缓存管理器 CacheManager
配置了缓存管理器后,Spring就允许用注解的方式使用缓存了。使用的注解有4个注解描述@Cachable表明在进入方法之前,Spring会先从缓存服务器中查找对应key的缓存值,如果找到缓存值,那么Spring将不再调用方法,而是将缓存值直接返回给调用者;如果没有找到缓存值,那么spring就会执行方法,将最后的结果通过key保存到缓存服务器中。@CachePutSpring会将该方法的返回值缓存到缓存服务器中。spring不会事先去缓存服务器中查找,而是直接执行方法,然后缓存。...转载 2022-08-06 16:39:52 · 3350 阅读 · 0 评论 -
引入某个 maven dependency 时爆红
maven plugin - lifecycle 里 clean 再 install 也不成功!删几个字母,重打,激活 idea 的自动提示。这个 jar 包在 local repo 里。原创 2022-08-05 17:58:51 · 133 阅读 · 0 评论 -
redis template,几个警告⚠解决集锦
参考此篇大佬文章即可解决:在注入类的时候,@Autowired可能会出现类似于此类问题出现此情况有多种解决方法文章目录解决1:启动类位置解决2:降低Bean的安全级别解决3:将@Autowired改为@Resource。...原创 2022-08-05 15:13:41 · 3414 阅读 · 0 评论 -
Caused by: org.junit.platform.commons.JUnitException: MethodSelector [className = ‘com.
解决了,手写import org.junit.jupiter.api.Test;,然后Alt+enter添加最新版本juint(5.8)之前是5.5。转载 2022-08-05 14:57:27 · 4511 阅读 · 0 评论 -
No archetype found in remote catalog. Defaulting to internal catalog
No archetype found in remote catalog. Defaulting to internal catalog原创 2022-08-05 14:15:55 · 108 阅读 · 0 评论 -
Spring Data Redis Ref Doc
NoSQL 存储席卷了存储世界。这是一个广阔的领域,有大量的解决方案、术语和模式(更糟糕的是,甚至这个术语本身也有多种含义)。虽然有些原则很常见,但您必须在一定程度上熟悉 SDR 支持的商店。熟悉这些解决方案的最佳方法是阅读他们的文档并遵循他们的示例。完成这些练习通常不会超过五到十分钟,如果您来自 RDMBS-only 背景,很多时候这些练习可以让您大开眼界。......翻译 2022-08-05 11:00:35 · 112 阅读 · 0 评论 -
如何根据订单冻结部分余额 与 解冻
根据订单金额冻结账户钱包中部分余额业务流程原创 2022-07-22 18:12:11 · 219 阅读 · 0 评论 -
低级错误之 实例化Servlet类异常
报的是找不到该类想一想,tomcat 手里的地图是谁?他拿什么路标找?web.xml查找 package name 路径,是对的,路径包里也确实有AddServlet.那怎么会找不到呢?最终原因,web.xml 类名少写一个 “v”. 路标牌子标错了。...原创 2022-06-29 17:48:44 · 1121 阅读 · 0 评论