Building tdlight natives for aarch64

If you trying to build your project with tdlib on MacOS M1 (Apple Silicon chip), you probably are gonna face this error: You need to compile these natives for aarch64 architecture. The final artifact will be named as: tdlight-natives-osx-aarch64. NOTE: If you want to take compiled artifact, just download it from my repo, then put into […]

READ MORE

Java 8 date/time type not supported

Suppose you want to serialize some object to JSON. You may encounter the exception: We need to do two steps: Firstly, let’s add dependency from https://mvnrepository.com/artifact/com.fasterxml.jackson.datatype/jackson-datatype-jsr310. Next, let’s register JavaTimeModule within ObjectMapper: If you working with Spring or with some other framework, ObjectMapper can be instantiated implicitly. You need to override instantiation by yourself. For […]

READ MORE

No implementation of L32X64MixRandom

You may encounter exception, that states: The reason is JDK/JRE version and vendor. I noticed, that at least JBR-17 (JetBrains Runtime) hasn’t got L32X64MixRandom algorithm. You may want to switch to Azul-17 (Azul Zulu) to make it works again. If you build/run your application with Gradle, don’t forget to change Gradle JVM version in IntelliJ […]

READ MORE

Maven dependency exclusion not working

This article helps you in such cases: There are at list two reasons of such problems: 1. This dependency is transitive for other dependency, not that one, where you made exclusion. Thus you need to add exclusion tag somewhere else (if your exclusion is located in section, not plugin-level). mvn dependency:tree is very useful for […]

READ MORE

log4j 1.x to log4j 2.x bridge migration

Even though you may want to merely copy & paste the code below, I suggest you firstly explore carefully the article describing how Java logging works, what is slf4j, what is log4j, what is bridge and how it works: https://mchesnavsky.tech/how-the-java-logging-should-works/, and then return back. In this article you’ll find the answers for these questions: Suppose […]

READ MORE

How the Java logging should works

In this article you will find the answers for these questions: Let’s start To begin with, there is two main concepts in Java logging: The problem Suppose the you’re Java library developer (let’s say it’s called our_library), not standard Java application developer. You need to have logging in your library. Suppose you have chosen log4j. […]

READ MORE

Spark Java access remote HDFS

Suppose we need to work with different HDFS (clusterB, for instance) from our Spark Java application, running on clusterA. Firstly, you need to add –conf key to your run command. Depends on Spark version: Secondly, when you creating Spark’s Java context, add that: You need to go to clusterB and gather core-site.xml and hdfs-site.xml from there (default location for Cloudera is /etc/hadoop/conf) […]

READ MORE

Java access remote HDFS from current Hadoop cluster

Suppose we have our Java app running on Hadoop clusterA, and we want to access remote HDFS based on Hadoop clusterB. Let’s see how we can do it: You need to go to clusterB and gather core-site.xml and hdfs-site.xml from there (default location for Cloudera is /etc/hadoop/conf) and put near your app running in clusterA. […]

READ MORE

Java SSL certificate revocation check

There is two common way to check TLS certificate revocation status: Certificate Revocation List (CRL) Online Certificate Status Protocol (OCSP) The second option is more faster and modern way to do that. The OCSP link must be presented some way to do that. There are at least two options: Your Certificate Authority (CA) automatically puts […]

READ MORE