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

Python mypy / isort type ignore for long import

Suppose you have mypy + black + isort tools, and long import line, which you need to mark as ignored for mypy. You’ll probably start doing smth like this: And after you run isort & black, you’ll end up in this situation: Which will break mypy’s type: ignore annotation. To make things work we need […]

READ MORE

Gradle NoClassDefFoundError XmlSlurper

If you getting this error: while building your app through Gradle, most likely that means that some of your Gradle plugins are not compatible with your version of Gradle. Consider changing either Gradle to the appropriate version or a problematic Gradle plugin. In my case, the latest com.github.ben-manes.versions plugin version was not compatible with my Gradle 6.x.

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