HBase client 1.x with gRPC

Imagine, that you need to use the HBase client 1.x and gRPC in the same Java application. The code for connecting dependencies to Maven will look something like this: If you run the application and execute the request through the HBase client, there will be an exception: The problem is that hbase-client 1.x uses an earlier […]

READ MORE

VisualVM redefinition failed with error 62

Error: This occurs when you try to profile a Java application through JVisualVM. This is a bug. A workaround can be found here. The application you want to profile must be launched with the flag: Example for regular jar: An example for Spring Boot Yarn is below. The application.yml file for AppMaster: After that, profiling […]

READ MORE

Can’t open file Spring Boot Yarn

Suppose, that we need to read the file from the Spring Boot Yarn application. We seem to have done everything right: placed the file next to the Yarn-client, Yarn-container and Yarn-appmaster jars; have used the File class, Files class, FileInputStream class and others. But for some reason we see exceptions like below: The problem is […]

READ MORE

Exclude package from Maven-PMD and Findbugs

Suppose, that you need to exclude the package from the maven-pmd-plugin, or you need to exclude the package from findbugs-maven-plugin.  maven-pmd-plugin Pmd definition in project pom.xml: Pmd configuration file pmd-exclude.xml: findbugs-maven-plugin Findbugs definition in project pom.xml: Findbugs configuration file findbugs-exclude.xml:

READ MORE

Unrecognized field JSON

Exception text: Most likely the code looks like this: The error is that the names of getter and setter are not consistent with the corresponding field. getVar2() and setVar2() should be named getVar1() and setVar1():

READ MORE

Spring Boot REST vs gRPC compatibility

Suppose you are using Spring Boot and you have a REST controller: At some point you need to connect the gRPC to the project without disabling REST controller. The gRPC code looks something like this: Then you find out that you can’t start REST server together with gRPC. gRPC will start, but REST will not. […]

READ MORE

Guava version compatibility issue

Spring Boot errors Pure Java exceptions Suggested solutions Method Guava version com.google.common.base.Preconditions.checkArgument 26.0-jre / 26.0-android com.google.common.base.Preconditions.checkState 21.0 com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor 18.0 / 19.0 Let me remind you that guava with maven is connected like this: If suggested verions don’t fix the problem, you can try connecting the specified versions in order: 18.0 / 19.0 / 21.0 / […]

READ MORE

Generate SSL certificate with User Principal Name openssl

We assume that openssl is already installed. User certificate with a UPN field Create a new file named ext.cnf in the folder where we are going to generate certificates. Write the line to the file: Replace text your_text_here with your own. The rest does not need to be touched. Now, you need to add a […]

READ MORE