Guide to CompletableFuture join() vs get()
1. Introduction In Java’s concurrent programming, CompletableFuture is a powerful tool that allows us to write non-blocking code. When working with CompletableFuture, we’ll encounter two common...
View ArticleJava Weekly, Issue 548
1. Spring and Java >> Getting Started with Jakarta Data and Hibernate [thorben-janssen.com] Jakarta Data, a new specification in Jakarta EE 11: a repository abstraction on top of Jakarta...
View ArticleRead Last N Lines From File in Java
1. Introduction In this article, we’ll see how can we read the last N lines from a file using different standard Java packages and the Apache Commons IO library. 2. Sample Data We’ll use the sample...
View ArticleHow to Fix PSQLException: Operator Does Not Exist: Character Varying = UUID
1. Introduction In this tutorial, we’ll explore the PSQLException error: “operator does not exist: character varying = uuid” when using JPA to interact with PostgreSQL. We’ll delve into why this error...
View ArticleTesting CORS in Spring Boot
1. Overview Cross-Origin Resource Sharing (CORS) is a security mechanism that allows a web page from one origin to access resources from another origin. It’s enforced by browsers to prevent websites...
View ArticleGuide to FileWriter vs. BufferedWriter
1. Overview In this tutorial, we’ll look at the performance differences between two basic Java classes for writing files: FileWriter and BufferedWriter. While conventional wisdom on the web often...
View ArticleContainerize a Spring Boot Application With Podman Desktop
1. Overview In this tutorial, we’ll learn how to containerize a Spring Boot application using Podman Desktop. Podman is a containerization tool that allows us to manage containers without requiring a...
View ArticleFixing UnsupportedTemporalTypeException: Unsupported Field: InstantSeconds
1. Overview When working with dates, we often leverage the Date-Time API. However, manipulating or accessing temporal data may lead to errors and exceptions when done improperly. One such specific...
View ArticleA Guide to Structured Output in Spring AI
1. Introduction Typically, when using large language models (LLMs), we don’t expect a structured response. Moreover, we got used to their unpredictable behavior, which often leads to outputs that do...
View ArticleProtobuf vs. gRPC
1. Overview In software development, microservices architecture has become a favorable approach for creating scalable and maintainable systems. Effective communication among microservices is crucial,...
View ArticleInsert JSON Object into PostgreSQL using Java preparedStatement
1. Introduction In modern software development, handling JSON data has become ubiquitous due to its lightweight and versatile nature. PostgreSQL, with its robust support for JSON, provides an excellent...
View ArticleMessage Conversion in Spring Cloud AWS v3
1. Overview Message conversion is the process of transforming messages between different formats and representations as they’re transmitted and received by applications. AWS SQS allows text payloads,...
View ArticleCreate a RAG (Retrieval Augmented Generation) Application with Redis and...
1. Overview In this tutorial, we’ll build a ChatBot using the Spring AI framework and RAG (Retrieval Augmented Generation) technique. With the help of Spring AI, we’ll integrate with the Redis Vector...
View ArticleResolving PostgreSQL JSON Type Mismatch Errors in JPA
1. Introduction In this tutorial, we’ll explore the common PSQLException error: “column is of type json but the expression is of type character varying” when using JPA to interact with PostgreSQL....
View ArticleGuide to getResourceAsStream() and FileInputStream in Java
1. Overview In this tutorial, we’ll explore the differences between different methods of reading files in Java. We’ll compare the getResourceAsStream() method and the FileInputStream class and discuss...
View ArticleCheck Whether a Collection Contains an Element or Not Using Hamcrest
1. Overview When we write unit tests in Java, especially with the JUnit framework, it’s common to verify that a Collection contains a specific element. As a powerful library, Hamcrest offers a simple...
View ArticleFinding Max and Min Date in List Using Streams
1. Overview In this article, we’ll explore how to find the maximal and minimal date in a list of those objects using Streams. 2. Example Setup Java’s original Date API is still widely used, so we’ll...
View ArticleHow to Fix Hibernate UnknownEntityException: Could not resolve root entity
1. Overview In this short tutorial, we’ll elucidate how to solve the Hibernate UnknownEntityException: “Could not resolve root entity”. First, we’ll explain the root cause leading to the exception....
View ArticleJava Weekly, Issue 549
1. Spring and Java >> Why Update Data-Oriented Programming to Version 1.1? [inside.java] An insightful journey into the world of data-oriented programming. A solid read. >> Dynamic...
View ArticleList All Files on the Remote Server in Java
1. Overview Interacting with a remote server is a common task in modern software development and system administration. Programmatic interaction with a remote server using an SSH client allows for...
View Article