自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(34)
  • 收藏
  • 关注

原创 Replace Log4jConfigListener With Log4jServletContextListener

Log4jConfigListener could not be found

2022-07-19 14:04:23 173 1

原创 how to exclude a dependency from parent in child module

There is situation where a dependency from parent is intended to be excluded in child module.Declaring the dependency which tend to be excluded in child module with test scope is the solution.For example:Here is the parent pom looks like:<depen

2022-04-27 00:22:16 136

原创 usage of jenv

Let jenv manage multiple version of java.brew install jenvecho 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profileecho 'eval "$(jenv init -)"' >> ~/.bash_profileor echo to .zshrc(depends on your shell, for chechking use "echo $SHE

2021-04-22 21:55:19 109

原创 validate the JSON WEB TOKEN

The JWT(json web token) has three parts, they looks like as below:header:{ "kid": "XXX", "alg": "RS256"}payload:{{ "sub": "1234567890", "name": "John Doe", "iat": 1516239022}signature:RS256(header.payload + secret key)The payload ...

2020-12-30 17:09:22 134 1

原创 usage of openssl

1. only convert the private key file in pem format to pkcs12 format(without certificate)openssl pkcs12 -export -nocerts -inkey privatekey.pem -out privatekey.p122. convert the certificate in pem format to pkcs(without private key)openssl pkcs12 -exp

2020-12-18 00:16:55 110

原创 Configure certificate RestTemplate to make https rest call

There is a condition that you have already got the server certificate file and private key, let's say in pem format.Then you need to use openssl transform it to pkcs12 format or others.Here is the openssl command:openssl pkcs12 -export -name serverce..

2020-12-16 22:03:41 120 1

原创 The reference of “Using a TaskDecorator to copy MDC data to @Async threads“

When using @Async, there will be a new thread to execute the task the task which is annoted with @Async. In a case that you tend to copy the data from the original thread to the @Async thread,like this case - copy MDC data to @Async thread, then you need t

2020-09-08 22:45:08 113

原创 扩展Jmeter 以支持WebSocket

需要下载Jar 包以让Jmeter 支持websocket:JMeterWebSocketSampler-xxxx.jar (https://github.com/maciejzaleski/JMeter-WebSocketSampler/releases/tag/....)下面六个去任意maven 仓库下载jetty-http-9.1.2.v20140210.jarjetty-io-9.1.2.v20140210.jarjetty-util-9.1.2.v20140210.jarwebs

2020-08-11 10:52:20 109

原创 How to use SonarQube

Firstly, you need to have a SonarQube Server to analyse your projects.There are many ways you can run a SonarQube Server locally or remotely. The details you can find from https://docs.sonarqube.org/latest/.Here is a fast way to run a SonarQube locall.

2020-07-31 22:06:28 166

原创 SprintBoot Test

When you test controller for a SpringBoot application, you might don't want to run a whole application, you just what to test the controller itself. So this give you possibility to do this.@ExtendWith(SpringExtension.class)@SpringBootTest(classes = {M.

2020-07-29 17:11:24 68

原创 java.lang.NoSuchMethodError: javax.ws.rs.core.MultivaluedMap.addAll(Ljava/lang/Object;[Ljava/lang/Ob

got the error below when using jersey-client;java.lang.NoSuchMethodError: javax.ws.rs.core.MultivaluedMap.addAll(Ljava/lang/Object;[Ljava/lang/Object;)Vit is because dependency confiction.In my case, I have the "com.sun.jersey"<dependency>.

2020-07-29 16:46:41 2315

原创 MessageBodyWriter not found for media type=application/json

add dependency:<dependency> <groupId>org.glassfish.jersey.media</groupId> <artifactId>jersey-media-json-jackson</artifactId> <scope>runtime</scope></dependency>

2020-07-29 16:43:29 844

原创 How to use Spring‘s MockMvc unit test controller

@RunWith(SpringRunner.class)@SpringBootTest(classes= Application.class)@AutoConfigureMockMvcpublic class RequestGen3IdControllerTest { @Autowired private WebApplicationContext webApplicationContext; @Before public void before() { .

2020-07-14 16:54:16 67

原创 Open & Close a port in a machine

As a developer, you also need to deploy some war file to a VM so that yo can have a test or for other aim.You need to know that the configuration file is located in :/etc/sysconfig/iptablesFirst, you may want to check whether the port is opened , you .

2020-07-06 22:30:30 103

原创 got error caused by Class java/util/UUID could not be instrumented

usingjacoco-maven-plugin got error, which says cauesd by :Class java/util/UUID could not be instrumented.update the version ofjacoco-maven-plugin, so far I updated to0.8.2 , it works fine.

2020-06-28 22:37:28 935

原创 输出JAXB 的XML

JAXBContext jc = JAXBContext.newInstance(TargetObject.class); TargetObject targetObject = new TargetObject();// create your own xml object Marshaller marshaller = jc.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, tru.

2020-06-20 21:45:06 108

原创 Import certificates to java keystore using keytool

the security stuff are store in the paht: $JAVA_HOME/jre/lib/security/cacertsthe cacerts are the keystore1. cd $JAVA_HOME/$JAVA_HOME/jre/lib/security/2. keytool -import -alias cacerts -keystore cacerts -file certfile_path

2020-06-05 10:28:36 135

原创 mvn release:prepare without committing the version change to git/svn

When execute mvn release, using the maven-release-plugin with the version 2.3.X or 2.4.X, it succeed but the package is snapshot version but isn't a valid release one. it is because the version. It works fine for me that update the version ofmaven-release.

2020-05-25 22:13:49 164

原创 tomcat bash

#!/bin/bashAPP_NAME=app.jar#使用说明,用来提示输入参数help() { echo "Usage: sh 脚本名.sh [start|stop|restart|status]" exit 1}is_exist(){ pid=`ps -ef|grep $APP_NAME|grep -v grep|awk '{print $2}' `...

2020-03-25 14:03:27 132

原创 How to access the resources in a springboot service

For instance:I new a director under resources in a springboot service. See screenshot:There are four ways to access the files:1.ClassPathResource classPathResource = new ClassPathResource("...

2020-03-25 14:01:15 100

原创 ssh 端口启动程序,窗口关闭后程序退出

nohup comman >> output.txt 2>&1 & 最后一个&表示后台启动

2020-03-16 13:38:23 353

原创 网络知识

DNS 地址: 114.114.114.114子网掩码的作用: 控制有多少台电脑可以访问你的机器子网掩码换算:例如: 192.168.8.91/24(/ 之后代表子网掩码,有 四种格式:8 16 24 32)以24 举例:11111111 11111111 11111111 00000000 => 255.255.255.0则8 为:11111111 000000...

2020-03-12 23:37:11 261

原创 Change Column Type On PostgreSql

alter table table_name ALTER COLUMN column_name TYPE bytea USING headimage::TEXT::BYTEA需要先转换为text 再转为 目标类型, 直接转不成功

2020-03-11 16:35:44 173

原创 Mac Idea Keyboard Shorcuts

格式化:commond + option + L左移代码块:tab右移代码块:shift + tab

2020-03-10 08:56:20 95

原创 Linux Commands

File file path by file name:find / -type f -name "file name"

2020-03-04 20:26:33 57

原创 mysql in huawei cloud can not be connected remotely

在华为云服务器上安装了mysql , 远程不能连接。step1 : 确保mysql server 启动step2:华为云服务器设置安全组,入方向开放3306端口step3:服务器开发3306CentOs7以下开启方式iptables-IINPUT-ptcp--dport3306-jACCEPTiptables saveserviceiptablesr...

2019-12-01 02:05:41 122

原创 Install telnet on Linux environment

step1:检测 telnet-server 是否安装 rpm -qa telnet-server (若无任何输出,则没有安装)step2:yum install telnet-server (安装telnet server)step3 : 检测 telnet 是否安装, rpm -qa telnet ...

2018-10-24 17:36:45 598

原创 使用@value 注解获取配置文件的值要在Spring配置文件中添加如下配置

在Spring配置文件中配置定义的properties文件的值:1.可以使用properties bean 配置2.在service,dao controller中都要获取配置的属性则在Spring配置文件中添加一下配置&lt;context:property-placeholder location="classpath:resources/filepath.properties"/...

2018-09-11 15:28:56 640

原创 下载Excel ----Java

            response.reset();            response.setContentType("application/vnd.ms-excel");            response.setHeader("Content-disposition","attachment;filename="+URLEncoder.encode("filename",...

2018-09-07 18:12:16 79

原创 Personal experiences related git

1.放弃本地更改,未add,未commitgit checkout filename注:与git checkout branch 区别2.放弃已add未commit的更改git reset HEAD filename ---------------只是撤销add 操作,本地修改不会丢失3.放弃已经commit的修改git reset --har...

2018-09-06 11:29:00 3336

原创 ELK之ELASTICSEARCH 集群搭建

ELK之ELASTICSEARCH 集群搭建1.已经安装好jdk,jdk版本8 及 8+2.下载解压elasticsearch tar文件 并解压3.修改配置文件,主要是config 目录下的elasticsearch.yml &amp; jvm.options   3.1 elasticsearch.yml        cluster.name                         ...

2018-07-12 10:58:25 261

原创 zeppelin 使用pyspark python的版本问题

问题描述:spark2 中python 版本为2.6,当执行操作的时候会报错,如下提示step1:下载anaconda3  wget https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh        并进如下载目录执行bash Anaconda3-5.0.1-Linux-x86_64.sh 进行安装step2: 配置z...

2018-06-12 09:35:22 1670

原创 angular commands used frequently

ng new 项目名 ----------新建一个项目ng new 项目名 --routing --------新建一个带路由的项目(在项目下会生成一个app.routing.module.ts文件)ng g component ---------在项目内新建一个组件ng g service ---------项目内新建一个服务ng g pipe 路径 --------...

2018-05-29 12:45:12 364

转载 一致性Hash算法

算法的具体原理这里再次贴上:先构造一个长度为232的整数环(这个环被称为一致性Hash环),根据节点名称的Hash值(其分布为[0, 232-1])将服务器节点放置在这个Hash环上,然后根据数据的Key值计算得到其Hash值(其分布也为[0, 232-1]),接着在Hash环上顺时针查找距离这个Key值的Hash值最近的服务器节点,完成Key到服务器的映射查找。这种算法解决了普通余数Hash算法...

2018-04-09 22:33:30 79

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除