Skip to content

2020

Spring MyBatis

Simple Configurations

  • mybatis.mapper-location = classpath_:mapper/_*/.xml
  • mybatis.type-aliases-package = type alias' package name
  • mybatis.type-handlers-package = type handler package name
  • mybatis.configuration.map-underscore-to-camel-case = true

Chrome uBlacklist Plugin Confuguration

General

Bash
*://*/so.php
*://*/so.php?s=*
*://*/cha.php?s=*
*://*/list.php?s=*
*://*/?s=*
*://*/so/*
*://*.hotbak.net/*

Subscription

Bash
https://raw.githubusercontent.com/cobaltdisco/Google-Chinese-Results-Blocklist/master/uBlacklist_subscription.txt   

Disable Git Command Openssh Popup

If you don't want to input git username and password through the openssh popup, you can disable it by the following configuration.

Bash
# global configuration
git config --global core.askPass ""
# just this clone
git -c core.askPass="" clone <https_url>

With this configuration, the git will read username and password through the console.

JDK 14 - JEP 359 Records

With the JDK 14 preview feature record, we can write entity class like,

Java
public record BankTransaction(LocalDate date,
                              double amount,
                              String description) {}
the compiler will generate the contsuctor, the getter methods, the toString, the hashCode and the equals methods.

Let's decompie the class to see how the methods are generated.

HTTPS connection bug in Java version 1.8.60 when connected with slack.com

Recently, our Jenkins job integrated with slack.com occurred error like,

Java
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:992)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
    at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:543)
    at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:409)
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304)
    at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446)
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at jenkins.plugins.http_request.util.HttpClientUtil.execute(HttpClientUtil.java:155)
    at jenkins.plugins.http_request.HttpRequest.performHttpRequest(HttpRequest.java:298)
    at jenkins.plugins.http_request.HttpRequest.performHttpRequest(HttpRequest.java:262)
    at jenkins.plugins.http_request.HttpRequestStep$Execution.run(HttpRequestStep.java:220)
    at jenkins.plugins.http_request.HttpRequestStep$Execution.run(HttpRequestStep.java:195)
    at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
    at hudson.security.ACL.impersonate(ACL.java:213)
    at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
    at sun.security.ssl.InputRecord.read(InputRecord.java:505)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
    ... 24 more