ClassNotFoundException vs NoClassDefFoundError
1. Introduction Both ClassNotFoundException and NoClassDefFoundError occur when the JVM can not find a requested class on the classpath. Although they look familiar, there are some core differences...
View ArticleJava Web Weekly, Issue 178
Lots of interesting writeups on Java 9 this week. Here we go… 1. Spring and Java >> Under The Hood With the JVM’s Automatic Resource Management [infoq.com] A deep dive into the mechanics behind...
View ArticleSpring Cloud – Adding Angular 4
1. Overview In our last Spring Cloud article, we added Zipkin support into our application. In this article, we’re going to be adding a front-end application to our stack. Up until now, we’ve been...
View ArticleIntroduction to JUnitParams
1. Overview In this article, we’ll explore the JUnitParams library and its usages. Simply put, this library provides easy parameterization of test methods in JUnit tests. There are situations where...
View ArticleIntroduction to Testing with Arquillian
1. Overview Arquillian is a container-agnostic integration testing framework for Java EE. Using Arquillian minimizes the burden of managing containers, deployments, framework initializations, and so...
View ArticleGuide to Dynamic Tests in Junit 5
1. Overview Dynamic testing is a new programming model introduced in JUnit 5. In this article, we’ll have a look at what exactly dynamic tests are and how to create them. If you’re completely new to...
View ArticleHow to Get the Last Element of a Stream in Java?
1. Overview The Java Stream API was the major feature of the Java 8 release. Streams represent lazily-evaluated sequences of objects and provide a rich, fluent, and monadic-like API. In this article,...
View ArticleHiring a Technical Editor for Baeldung
This is definitely not the typical code focused style of article I usually publish here on Baeldung. Jumping right into it – the site is growing, more and more developers are applying to become...
View ArticleGuide to Escaping Characters in Java RegExps
1. Overview The regular expressions API in Java, java.util.regex is widely used for pattern matching. To discover more, you can follow this article. In this article, we will focus on escaping...
View ArticleThe Dining Philosophers Problem in Java
1. Introduction The Dining Philosophers problem is one of the classic problems used to describe synchronization issues in a multi-threaded environment and illustrate techniques for solving them....
View ArticleJava 9 Optional API Additions
1. Overview In this article, we will be looking at the Java 9 additions to the Optional API. Beyond modularity, Java 9 is also adding three very useful methods for the Optional class. 2. The or()...
View ArticleJava Web Weekly, Issue 179
Lots of interesting writeups on Java 9 this week. Here we go… 1. Spring and Java >> What archive format should you use, WAR or JAR? [frankel.ch] In the world of “java -jar”, it’s important to...
View ArticleSimple Single Sign On with Spring Security OAuth2
1. Overview In this tutorial, we’ll discuss how to implement SSO – Single Sign On – using Spring Security OAuth and Spring Boot. We’ll use three separate applications: An Authorization Server – which...
View ArticleThe Difference Between map() and flatMap()
1. Overview map() and flatMap() APIs stem from functional languages. In Java 8, you can find them in Optional, Stream and in CompletableFuture (although under slightly different name). Streams...
View ArticleIntro to Structurizr
1. Introduction This article is about Structurizr, a tool that provides a programmatic approach to architectural definitions and visualizations based on the C4 Model. Structurizr breaks with...
View ArticleJava 9 Reactive Streams
1. Overview In this article, we’ll be looking at the Java 9 Reactive Streams. Simply put, we’ll be able to use the Flow class, which encloses the primary building blocks for building reactive stream...
View ArticleHow to Round a Number to N Decimal Places in Java
1. Overview In this short article, we’re going to look at how to round a number to n decimal places in Java. 2. Decimal Numbers in Java Java provides two primitive types that can be used for storing...
View ArticleSpring Boot and Kotlin
1. Overview A big announcement was made back in January in the Spring ecosystem: Kotlin support is coming to Spring Framework 5. This means that Spring Boot 2.x will have first class support for...
View ArticleGuide to Akka Streams
1. Overview In this article, we will be looking at the akka-streams library that is built atop of the Akka actor framework, which adheres to the reactive streams manifesto. The Akka Streams API allows...
View ArticleMerging Streams in Java
1. Overview In this quick article, we explain different ways of merging Java Streams – which is not a very intuitive operation. 2. Using Plain Java The JDK 8 Stream class has some useful static...
View Article