加载中
org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection;

异常信息: ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.alibaba.druid.pool.GetConnectionTimeou...

Springboot @Value 静态属性注入

普通属性注入没啥好说的,就说一下静态属性注入的, Spring支持set方法注入,我们可以利用非静态Set方法注入静态变量,并且使用@Value的类必须交给spring进行管理(即类上添加@Compent、@Re...

springboot把Tomcat替换为undertow和调优参数

添加 maven配置: 去掉tomcat <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <version>2.3.6.RELEASE</version> <exclusio...

autoType is not support. org.springframework.cache.interceptor.SimpleKey

redis使用序列化异常,具体信息如下: com.alibaba.fastjson.JSONException: autoType is not support. org.springframework.cache.interceptor.SimpleKey at com.alibaba.fastjson.parser....

2022/08/22 17:44
696
cn.dev33.satoken.exception.SaTokenException: 非Web上下文无法获取Request

ServletRequestAttributes对象获取不到的情况一般分为以下几种情况: 1、异步线程调用。例如@Async注解的情况 2、子线程调用的情况。由于RequestContextHolder使用ThreadLocal共享数据,子线...

2022/07/31 16:48
1W
springboot 指定某个时间点执行定时任务

用到的组件: springboot的实现CommandLineRunner接口或者使用@PostContruct注解 Timer、TimerTask LocalDateTime 具体实现: 一、实现CommandLineRunner import org.springframework.boot.C...

2022/07/19 09:42
5.5K
springboot监听失效redis的key

在springboot项目中配置监听redis的失效key: 注入redis消息监听容器 /** Redis 消息监听器容器. [@param] redisConnectionFactory [@return] */ @Bean public RedisMes......

在springboot的yml配置map如果key中含有 / * 等特殊字符,key 需要加 “[ ]”

背景:在yml中配置redis的key,一般是xx:xx:xx,这种形式。于是在yml一顿操作,就写的长这样: redis: mapkeys: "user:list": 40 可以最后在springboot中获取之后,key直接变成userlist,也就...

2022/04/20 15:15
2K
Springboot使用@JsonIgnore的坑

springboot项目中使用注解目的com.fasterxml.jackson.annotation.JsonIgnore是想解决返回json的结果不用带回某个被注解的字段。 这个目的确实能达到了,但是也把一个坑给带出来了: 这哥们是...

found character '@' that cannot start any token. (Do not use @ for indentation)

springboot项目在application.yml加入@profiles.active@ 如果没有出现profiles,那么是在pom中缺少以下配置 <profiles> <profile> <id>local</id> <properties> ......

Springboot项目启动完成后,自动打开浏览器的配置

增加命令行执行类 @Component public class StartSuccessful implements CommandLineRunner { @Value("${open.browser.url}") private String url = "http://localhost:8001/swagger-ui.html...

升级springboot到2.5.8 出现SchedulerConfigException(“DataSource name not set.“)

升级springboot项目到2.5.8版本,出现异常: Caused by: org.quartz.SchedulerConfigException: DataSource name not set. at org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(Jo...

2022/01/23 16:44
1.1W
Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest

单元测试Junit出现问题如下: 解决方法: 检查有没有写启动类: 例如: 如果写了启动类,那么就要检查它们的路径是否一致 找到错误: 修正过来,如下:

2022/01/14 16:44
210
SizeLimitExceededException: the request was rejected because its size (52428800) exceeds the config

springboot文件上传大小限制:SizeLimitExceededException: the request was rejected because its size (52428800) exceeds the configured maximum (10485760) 2.0以后的版本处理方案: sp...

2021/09/10 10:54
1.5K
Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest

springboot单元测试异常:Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test,具体异常信息如下: java...

2021/08/11 11:43
574
js中ajax提交json数据,springboot后端@RequestBody接收

js中提交的数据格式如下: let param = { productKey: $("#productKey").val(), deviceName: $("#deviceName").val(), data: $("#data").val() }; let config = { url: "http://localhost/pu...

2021/07/15 13:57
2.2K
SpringBoot Long型数据丢失精度问题

方案一,在application.yml添加以下配置 spring: jackson: generator: ## 将数值类型转换为字符串,解决long型精度丢失 write_numbers_as_strings: true 返回结果是可以的,不过这个针......

2021/01/14 16:09
2.5K
【1】SpringBoot入门之helloworld

springboot快速入门,当然是官网的demo,程序入手之Hello World。 在IDE(Idea或者eclipse)创建项目,可以参考下图 https://start.spring.io/ 这边是在idea中生成的 1.pom文件 <?xml versio...

SpringBoot集成mybatis

新建springboot项目,修改application.yml文件如下内容,添加数据库连接和mybatis扫描配置的路径 spring: datasource: url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEnc...

没有更多内容

加载失败,请刷新页面

返回顶部
顶部