How to convert a Map to JSON in Java

When working with Java, it’s often necessary to convert data structures to and from different formats, especially when dealing with JSON data. Fortunately, libraries like Jackson provide robust support for JSON processing, allowing seamless conversion between Java objects and JSON representations. In this article, we’ll explore how to convert a Map to a JSON object using Jackson in Java.

Read more

How to check the content of a Java KeyStore

Java KeyStores (JKS) provide a secure way to store sensitive data, and they can be used by Java applications to encrypt and decrypt data, authenticate users, and secure network communications. In this tutorial we will check three ways to read the content of a KeyStore information such as the alias the the Certificate.

Read more

How to solve CVE-2023-44487

The CVE-2023-44487 vulnerability can be exploited by multiplexing requests through the HTTP/2 protocol and rapidly resetting the streams. This chain of events will result in high server resource consumption and eventually cause a Denial of Service. Let’s see which packages are affected and the current resolution or mitigation of the issue. HTTP/2 RESET of Connections … Read more

How to solve java.lang.NoSuchFieldError: EMPTY_BYTE_ARRAY

When deploying applications on WildFly, encountering a log4j2 core libs and log4j2 API mismatch issue is not uncommon. This issue, presented as java.lang.NoSuchFieldError: EMPTY_BYTE_ARRAY, arises due to discrepancies between the Log4j2 core libraries used within the application and the Log4j2 API provided by WildFly’s modules. Cause: Firstly, the mismatch occurs when the application uses a … Read more

How to solve FileNotFoundException: Invalid file path

This article discusses how to solve the JDK issue, which happens on WildFly on Windows, on certain JDK version, an results in the error “java.io.FileNotFoundException: Invalid file path“. The Issue As discussed in this JDK Bug , with java update cpuapr2022 (8u331 11.0.15 and 18.0.1), the Web Server undertow is broken for windows. When using … Read more

Getting started with API Management

API Management is a broad concept that encompasses the entire lifecycle of an API. It includes functions such as API design, documentation generation, versioning, developer onboarding, analytics, monitoring, and policy enforcement. In this turorial we will discuss the key aspects on an API Management tool, taking as example 3Scale, and we will show an example … Read more

How to Test Private Methods with JUnit

When writing unit tests, the best practice is to test public methods, as they are the entry points to your classes and provide the intended behavior to external consumers. Testing private methods, on the other hand, is often considered an implementation detail and not directly exposed to the external API. In this article, we will discuss why testing private methods is not generally a good option and explore an approach to test them using JUnit 5.

Read more