Using Java Assertions

2021 VietMX 0

1. Introduction The Java assert keyword allows developers to quickly verify certain assumptions or state of a program. In this article, we’ll take a look at how to […]

Class Loaders in Java

2021 VietMX 0

1. Introduction to Class Loaders Class loaders are responsible for loading Java classes during runtime dynamically to the JVM (Java Virtual Machine). Also, they are part of […]

Java – Try with Resources

2021 VietMX 0

1. Overview Support for try-with-resources — introduced in Java 7 — allows us to declare resources to be used in a try block with the assurance that the resources […]

Spring NoSuchBeanDefinitionException

2021 VietMX 0

1. Overview In this article, we are discussing the Spring org.springframework.beans.factory.NoSuchBeanDefinitionException – this is a common exception thrown by the BeanFactory when trying to resolve a bean that simply isn’t defined in […]

Unsatisfied Dependency in Spring

2021 VietMX 0

1. Overview In this quick tutorial, we’ll explain Spring’s UnsatisfiedDependencyException, what causes it, and how to avoid it. 2. Cause of UnsatisfiedDependencyException UnsatisfiedDependencyException gets thrown when, as the […]

@Lookup Annotation in Spring

2021 VietMX 0

1. Introduction In this quick tutorial, we’ll take a look at Spring’s method-level dependency injection support, via the @Lookup annotation. 2. Why @Lookup? A method annotated with @Lookup tells Spring […]

Spring – Injecting Collections

2021 VietMX 0

1. Introduction In this tutorial, we’re going to show how to inject Java collections using the Spring framework. Simply put, we’ll demonstrate examples with the List, Map, Set collection interfaces. 2. List With @Autowired […]

@Order in Spring

2021 VietMX 0

1. Overview In this tutorial, we’re going to learn about Spring’s @Order annotation. The @Order annotation defines the sorting order of an annotated component or bean. It has an optional […]

Spring @Primary Annotation

2021 VietMX 0

1. Overview In this quick tutorial, we’ll discuss Spring’s @Primary annotation which was introduced with version 3.0 of the framework. Simply put, we use @Primary to give higher preference to […]