连击 天
fork: star:
异常信息: ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.alibaba.druid.pool.GetConnectionTimeou...
普通属性注入没啥好说的,就说一下静态属性注入的, Spring支持set方法注入,我们可以利用非静态Set方法注入静态变量,并且使用@Value的类必须交给spring进行管理(即类上添加@Compent、@Re...
添加 maven配置: 去掉tomcat <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <version>2.3.6.RELEASE</version> <exclusio...
redis使用序列化异常,具体信息如下: com.alibaba.fastjson.JSONException: autoType is not support. org.springframework.cache.interceptor.SimpleKey at com.alibaba.fastjson.parser....
ServletRequestAttributes对象获取不到的情况一般分为以下几种情况: 1、异步线程调用。例如@Async注解的情况 2、子线程调用的情况。由于RequestContextHolder使用ThreadLocal共享数据,子线...
用到的组件: springboot的实现CommandLineRunner接口或者使用@PostContruct注解 Timer、TimerTask LocalDateTime 具体实现: 一、实现CommandLineRunner import org.springframework.boot.C...
在springboot项目中配置监听redis的失效key: 注入redis消息监听容器 /** Redis 消息监听器容器. [@param] redisConnectionFactory [@return] */ @Bean public RedisMes......
背景:在yml中配置redis的key,一般是xx:xx:xx,这种形式。于是在yml一顿操作,就写的长这样: redis: mapkeys: "user:list": 40 可以最后在springboot中获取之后,key直接变成userlist,也就...
springboot项目中使用注解目的com.fasterxml.jackson.annotation.JsonIgnore是想解决返回json的结果不用带回某个被注解的字段。 这个目的确实能达到了,但是也把一个坑给带出来了: 这哥们是...
springboot项目在application.yml加入@profiles.active@ 如果没有出现profiles,那么是在pom中缺少以下配置 <profiles> <profile> <id>local</id> <properties> ......
增加命令行执行类 @Component public class StartSuccessful implements CommandLineRunner { @Value("${open.browser.url}") private String url = "http://localhost:8001/swagger-ui.html...
升级springboot项目到2.5.8版本,出现异常: Caused by: org.quartz.SchedulerConfigException: DataSource name not set. at org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(Jo...
单元测试Junit出现问题如下: 解决方法: 检查有没有写启动类: 例如: 如果写了启动类,那么就要检查它们的路径是否一致 找到错误: 修正过来,如下:
springboot文件上传大小限制:SizeLimitExceededException: the request was rejected because its size (52428800) exceeds the configured maximum (10485760) 2.0以后的版本处理方案: sp...
springboot单元测试异常:Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test,具体异常信息如下: java...
js中提交的数据格式如下: let param = { productKey: $("#productKey").val(), deviceName: $("#deviceName").val(), data: $("#data").val() }; let config = { url: "http://localhost/pu...
方案一,在application.yml添加以下配置 spring: jackson: generator: ## 将数值类型转换为字符串,解决long型精度丢失 write_numbers_as_strings: true 返回结果是可以的,不过这个针......
springboot快速入门,当然是官网的demo,程序入手之Hello World。 在IDE(Idea或者eclipse)创建项目,可以参考下图 https://start.spring.io/ 这边是在idea中生成的 1.pom文件 <?xml versio...
新建springboot项目,修改application.yml文件如下内容,添加数据库连接和mybatis扫描配置的路径 spring: datasource: url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEnc...
没有更多内容
加载失败,请刷新页面
文章删除后无法恢复,确定删除此文章吗?
动弹删除后,数据将无法恢复
评论删除后,数据将无法恢复