
Spring
有关 Spring、SpringMVC、SpringBoot、SpringCloud 等相关内容
BigBox124
这个作者很懒,什么都没留下…
展开
-
Spring Cache 使用
具体详见博客:https://www.cnblogs.com/morganlin/p/12000223.html转载 2020-07-24 11:16:07 · 149 阅读 · 0 评论 -
gateway 启动报错:...... ‘org.springframework.http.codec.ServerCodecConfigurer‘ that could not be found
转载:https://www.cnblogs.com/xiaopotian/p/10944832.html将pom.xml中关于spring-boot-start-web模块的jar依赖去掉。错误分析:根据上面描述(Description)中信息了解到 GatewayAutoConfiguration 这个配置中找不到 ServerCodecConfig 这个 Bean。spring cloud gateway server 项目是一个 spring boot 项目,在启动的时候会去加载它的配置,其转载 2020-07-16 17:01:55 · 1749 阅读 · 0 评论 -
@JsonDeserialize 和 @JsonSerialize 基本使用
【需求】在前端性别显示“男 / 女”,而数据库中存储的是“1 / 0”,对应的 Pojo 也是使用的 Integer 类型,如何实现?【实现方式】方式一:通过使用工具类,在请求进入前,或响应前对参数进行处理,然后进行封装,此方法略方式二:使用 @JsonDeserialize 和 @JsonSerialize 注解对在序列化和反序列化时对参数进行处理【Pojo 类】@JsonDeserialize &nb原创 2020-07-13 18:15:06 · 27629 阅读 · 3 评论 -
解决 LocalDate 无法接收 Postman 请求参数的问题
1、请求参数为 Date 类型时:请求参数设置为【2020/10/12 12:22:30】即可@GetMapping("/date")public Date localDate(Date date) { return date;}2、请求参数为 LocalDate 类型时:需要在请求参数上使用 @DateTimeFormat 注解对请求参数进行格式化后,才能正常接收到请求参数// 也可以使用 pattern 自定义日期格式@GetMapping("/localdate")publi原创 2020-07-08 10:19:00 · 6008 阅读 · 0 评论 -
SpringCloud 解决 JDK 9 以上没有 JAXB API 的问题
解决方法:添加以下依赖<dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.3.0</version> </dependency> <...原创 2019-11-14 22:51:39 · 1209 阅读 · 0 评论 -
找不到@HystrixCommand注解
在 SpringCloud 整合熔断器(Hystrix)时,出现找不到@HystrixCommand注解,在 Eureka Discovery Client 中依赖为:<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-...原创 2019-11-14 22:38:58 · 2250 阅读 · 0 评论 -
SpringCloud Eureka 错误引入依赖出现的异常
在 SpringCloud 创建 Eureka Server 模块在模块中引入的依赖如下:<dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-netfl...原创 2019-11-14 16:16:49 · 1158 阅读 · 0 评论 -
Eureka发现客户端无法启动
Eureka发现客户端无法启动Eureka配置如下:出现的问题解决方法Eureka配置如下:1、Eureka Serverspring: application: name: eureka-serverserver: port: 1001eureka: instance: hostname: 127.0.0.1 client: register...原创 2019-11-14 00:23:50 · 1552 阅读 · 0 评论 -
启动 SpringBoot 时出现:java.io.IOException: The server sockets created using the LocalRMIServerSocketFact
【问题描述】新创建一个 SpringBoot 项目运行,出现一下异常:java.io.IOException: The server sockets created using the LocalRMIServerSocketFactory only accept connections from clients running on the host where the RMI remote objects have been exported. at sun.management.jmxremot原创 2020-07-06 12:16:38 · 11097 阅读 · 1 评论