Circular View Path Error
1. Introduction In this tutorial, we'll look at how we get and resolve Circular View Path errors in a Spring MVC application. 2. Dependencies To demonstrate this, let's create a simple Spring Boot web...
View ArticleView Bytecode of a Class File in Java
1. Overview Bytecode analysis is a common practice among Java developers for many reasons, like finding problems with code, code profiling, and searching classes with specific annotations. In this...
View ArticleWhen Does JPA Set the Primary Key
1. Overview In this tutorial, we'll illustrate the moment when JPA assigns a value to the primary key. We'll clarify what the JPA specification says, and then, we'll show examples using various JPA...
View ArticleSpring YAML vs Properties
1. Introduction YAML is a human-friendly notation used in configuration files. Why would we prefer this data serialization over the properties file in Spring Boot? Besides readability and reduction of...
View ArticleReturning the Generated Keys in JDBC
1. Overview In this quick tutorial, we're going to see how we can get the last auto-generated keys with pure JDBC. 2. Setup In order to be able to execute SQL queries, we're going to use an in-memory...
View Articleboolean and boolean[] Memory Layout in the JVM
1. Overview In this quick article, we're going to see what is the footprint of a boolean value in the JVM in different circumstances. First, we'll inspect the JVM to see the object sizes. Then, we'll...
View ArticleWhat Is the Hi/Lo Algorithm?
1. Introduction In this tutorial, we'll explain the Hi/Lo Algorithm. It is used mostly as a database identifier generation strategy. We'll start with the algorithm overview. Then, we'll show a...
View ArticleConcurrency in Spring WebFlux
1. Introduction In this tutorial, we'll explore concurrency in reactive programs written with Spring WebFlux. We'll begin by discussing concurrency in relation to reactive programming. After that,...
View ArticleHow to Define a Map in YAML for a POJO?
1. Overview In this tutorial, we'll walk through how we can use properties defined in a YAML file to configure values for a Map in our POJO classes. 2. POJO and YAML POJO classes are Plain Old Java...
View ArticleNoSuchMethodError in Java
1. Overview In this tutorial, we'll look at the java.lang.NoSuchMethodError and some ways to handle it. 2. NoSuchMethodError As the name suggests, the NoSuchMethodError occurs when a particular method...
View ArticleJava Weekly, Issue 347
1. Spring and Java >> Creating Efficient Docker Images with Spring Boot 2.3 [spring.io] No more Dockerfiles: Leveraging layered JARs and Buildpacks to create efficient Docker images for Spring...
View ArticleLeadership Election With Consul
1. Overview In this tutorial, we'll see how Leadership Election with Consul helps to ensure data stability. We'll provide a practical example of how to manage distributed locking in concurrent...
View ArticleHealth Indicators in Spring Boot
1. Overview Spring Boot provides a few different ways to inspect the status and health of a running application and its components. Among those approaches, the HealthContributor and HealthIndicator...
View ArticleUsing application.yml vs application.properties in Spring Boot
1. Overview A common practice in Spring Boot is using an external configuration to define our properties. This allows us to use the same application code in different environments. We can use...
View ArticleWeb Server Graceful Shutdown in Spring Boot
1. Overview In this quick tutorial, we're going to see how we can configure Spring Boot applications to handle shutdowns more gracefully. 2. Graceful Shutdown As of Spring Boot 2.3, Spring Boot now...
View ArticleReading a Line at a Given Line Number From a File in Java
1. Overview In this quick article, we're going to look at different ways of reading a line at a given line number inside a file. 2. Input File Let's start by creating a simple file named inputLines.txt...
View ArticleSpring MVC Async vs Spring WebFlux
1. Introduction In this tutorial, we'll explore the @Async annotation in Spring MVC, and then we'll get familiar with Spring WebFlux. Our goal is to have a better understanding of the difference...
View ArticleHow to Turn Off Swagger-ui in Production
1. Overview The Swagger user interface allows us to view information about our REST services. This can be very convenient for development. However, owing to security concerns, we might not want to...
View ArticleIntroduction to ArchUnit
1. Overview In this article, we'll show how to check the architecture of a system using ArchUnit. 2. What is ArchUnit? The link between architecture traits and maintainability is a well-studied topic...
View ArticleCustomizing the Login Page for Keycloak
1. Overview Keycloak is a third-party authorization server used to manage our web or mobile applications' authentication and authorization requirements. It uses a default login page to sign-in users on...
View Article