随笔分类 - java
java
摘要: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. )
阅读全文
摘要:java 在linux上 start、stop、restart、status等启动命令,sh脚本,appMgr.sh 放在reources/ops下 #!/usr/bin/sh APP_NAME="@project.name@-@project.version@.jar" DEPLOY_PATH=`
阅读全文
摘要:MapperScannerConfigurer中获取applicayion.yml配置,进行动态加载BasePackage
由于在MapperScannerConfigurer的bean 优先于@value,导致@value取出来的时候都是null,所以只能使用Environment 来获取值
阅读全文
摘要:解决spring mvc设置controller切面无效
阅读全文
摘要: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属性的值
阅读全文
摘要:maven pem.xml <dependency> <groupId>org.bouncycastle</groupId> <artifactId>bcprov-jdk15on</artifactId> <version>1.70</version> <!-- 请根据需要检查最新版本 --> </
阅读全文
摘要:org.springframework.retry.TryException:
Could not recover; nested exception is java.lang.AbstractMethodError: org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient.choose(Ljava/lang/String;Lorg/springframework/cloud/client/loadbalancer/Request;)Lorg/springframework/cloud/client/ServiceInstance;
springboot:2.7.18
springcloud:2021.0.4
服务注册中心:Eureka 2.2.9.RELEASE
负载均衡:Ribbon 2.2.9.RELEASE
服务调用:OpenFeign 2.2.9.RELEASE
阅读全文
摘要:java aspect 切面怎么获取 POST 数据,以及 获取FormData 文件跟form一起上传时候的参数 package com.test.aop; import com.alibaba.druid.sql.ast.statement.SQLIfStatement; import com.
阅读全文
摘要:实体类 public class PageResult<T>{ int page; int limit; Long count; String code; string msg; List<T> data; T example; public PageResult() { } } 转换的utils
阅读全文
摘要:pararent的pow.xml <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <project.build.sou
阅读全文
摘要:hikaripool-1 - starting... hikaripool-1 - start completed. 后不执行Application中main的方法,当然也不执行 InitializingBean的afterPropertiesSet , 原因 在@SpringBootApplica
阅读全文
摘要:官方文档 This is README file for Jad - the fast Java Decompiler. Jad home page: http://www.kpdus.com/jad.html Copyright 2001 Pavel Kouznetsov (jad@kpdus.c
阅读全文
摘要:import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servle
阅读全文
摘要:1、双亲委派机制 1.1 定义 当一个类加载器收到了类加载的请求的时候,他不会直接去加载指定的类,而是把这个请求委托给自己的父加载器去加载。 如果父类为空,交给bootstrap classloader 加载。 如果类还是无法被加载到,则触发findclass,抛出classNotFoundExce
阅读全文
摘要:一、sprinboot部分 1、springboottest 的springboot项目,写了controller测试 import org.springframework.beans.factory.annotation.Value; import org.springframework.web.
阅读全文
摘要:1、修改docker.service 因为远程传输,所以需要开启Docker的2375端口的远程访问权限。 修改docker.service配置 ]# vi /usr/lib/systemd/system/docker.service 在ExecStart=/usr/bin/dockerd-curr
阅读全文
摘要:RocketMQ 中出现 org.apache.rocketmq.store.logfile.DefaultMappedFile#warmMappedFile 作用的交出cpu控制权, 在unix中 使用是时间片算法,而在windows中是抢占式。 在时间片算法中,所有进程使用队列排队。操作系统会按
阅读全文
摘要:因为newLineAfterDeclaration 默认为true ,会在xml声明后生成一行空行 所以需要指定 format.setNewLineAfterDeclaration(false); 总的代码 try(FileOutputStream fileOutputStream=new File
阅读全文
摘要:一、zookeeper 准备配置三个zookeeper,因为我是单台模拟,所以需要使用不同的端口,使用版本是apache-zookeeper-3.6.3-bin (必须是3.5+) 1、第1个zookeeper vi conf/zoo.cfg 修改 dataDir 带指定目录下的 # The num
阅读全文
摘要:pom.xml配置 <dependency> <groupId>org.apache.skywalking</groupId> <artifactId>apm-toolkit-logback-1.x</artifactId> <version>{project.release.version}</v
阅读全文