gRPC transport and channel providers

Let’s discuss some details around that how gRPC manages transport providers. Remember, that we have two closely related concepts in gRPC: If you didn’t familiar with NameResolvers, I strongly encourage you to peruse previous part of our narrative here: https://mchesnavsky.tech/name-resolution-providers. This article will be about the latter. Alright, we should elaborate, that a gRPC channel […]

READ MORE

gRPC name resolution providers

We have something special today. It all started with that I updated grpc-java version from 1.43.2 to 1.60.0. Alright, I just updated dependency and anticipated it working. However, I run into exception on ManagedChannel build at the client side: Exception I got looks like this: Another modifications: If you’re looking for the simplest & quickest […]

READ MORE

JDK invalid target release

Suppose we just run into this error: And you use IntelliJ IDEA. The thing is that you need to double check at least four places that you have chosen the proper JDK version. Step #1 First things first, make sure that you have JDK 21 selected under File -> Project Settings -> Project -> SDK: […]

READ MORE

Java invalid or corrupt jarfile

Suppose you have an error: Or related one: The first thing you need to do is to check your main class defined in manifest. If you’re 100% sure that everything is all right, then check any running JVM processes, associated with that file and kill them. The thing is that you probably ran the old […]

READ MORE

Opencensus GCP class tried to access private field

If you getting these opencensus errors in GCP from time to time: It worth to recheck dependency version of each opencensus component, that actually presented in your final jar: You may have opencensus-api version 0.19.2, and opencensus-impl version 0.15.0. Thus solution is to equalize all these versions. You can review your dependency versions with following […]

READ MORE

Spring NoClassDefFoundError: JAXBException

If you facing this error: Then the reason is Java XML Binding, it is a tool for mapping between XML documents and Java objects. These classes has been removed from internal of JDK since 11 version and moved to Jakarta EE. This transition was happened with replacing javax to jakarta in package names. javax in your stacktrace tells us that […]

READ MORE

Testcontainers timed out waiting for URL to be accessible | Mockserver Mac M1 compatibility

Exception looks like this: Suppose you want to start mockserver docker image on Mac M1. Probably you doing something like this: Most likely this error happens because of poor docker x86-64 image compatibility with the ARM (M1) CPU architecture. If you see carefully, then you can find out that some versions of mockserver images (including […]

READ MORE

Accessing Spring Boot Actuator metrics programmatically

Suppose you have Spring Boot actuator in your application, and you want to access metrics programmatically. Or you want to gather a lot of system/application metrics initially. After you enable the Spring Boot actuator in your application (https://www.baeldung.com/spring-boot-actuators), just autowire all actuator auto wire candidates: You can use them like this: That’s all.

READ MORE

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