随笔分类 - springboot
springboot
摘要:java -jar arthas_boot.jar
告警 (Can not find java process. Try to run `jps` command lists the instrumented Java Hotspot VMs on the target system. )
阅读全文
摘要:MapperScannerConfigurer中获取applicayion.yml配置,进行动态加载BasePackage
由于在MapperScannerConfigurer的bean 优先于@value,导致@value取出来的时候都是null,所以只能使用Environment 来获取值
阅读全文
摘要:springboot下的纯html页面乱码带问号?
html访问后端接口 返回的
Content-Type: text/html;charset=ISO-8859-1
所以大概率是springboot编码影响到了html页面
在springboot的application.yml加上以下配置
server:
servlet:
encoding:
#enabled: true #让系统的CharacterEncdoingFilter生效
charset: UTF-8 #默认编码格式
force: true #强制request,response都使用charset属性的值
阅读全文
摘要:1、修改docker.service 因为远程传输,所以需要开启Docker的2375端口的远程访问权限。 修改docker.service配置 ]# vi /usr/lib/systemd/system/docker.service 在ExecStart=/usr/bin/dockerd-curr
阅读全文
摘要:Limited Setting Effect 中文描述 Java 8 -Xbootclasspath:<path> Sets the search path for bootstrap classes and resources. 设置引导类和资源的搜索路径。 不常用,否则要重新写所有Java 核心
阅读全文
摘要:Java 操作 Redis 的库有两个,Jedis 和 Lettuce,目前 SpringBoot 2.x 中已经将 Jedis 换成了 Lettuce 原因:Lettuce的连接redis太久没有操作,被强制关闭连接。 可以在spring-boot-starter-data-redis 查看是引用
阅读全文
摘要:若偶尔报错no operations allowed after connection closed
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
spring:
datasource:
# 数据源-1
primary:
url: jdbc:mysql://127.0.0.1:3306/test1?useSSL=false&autoReconnect=true&characterEncoding=utf8
driver-class-name: com.mysql.jdbc.Driver
username: root
password: root
阅读全文