In this article, we will create a new custom MBean. We will show how to configure this bean and then we will test it using Jolokia (JMX over HTTP). Before we start, I highly recommend that you also check our Jolokia and Spring boot tutorial before you proceed as it will make understanding this post much […]
How to configure Jolokia on a Spring boot server
In this article, we will find out how to configure Jolokia on a Spring Boot 2 server. We will also configure Jolokia on a different management port and a different base URL. Jolokia is a JMX over HTTP bridge that allows system administrators to access their MBeans and JMX functionalities over HTTP and JSON. Getting […]
The Java Comparable interface – Automatically sort collections
In this post, we will explore how to use the Java comparable interface to automatically sort collections of any classes. We will use the Java Collections from the util library as an example. Why interfaces are so important? Java interfaces are one of the most powerful features of the object oriented programming language. When a […]
How to improve the performance of ArrayLists in Java
In this post we will discuss the little known trick of setting an ArrayList’s initial capacity to improve the performance of your Java applications and optimizing the usage of the often used data structure. The good news is that it takes a minimal amount of work and can get you a performance boost of up […]
Spring Boot & Freemarker Configuration Example
Freemarker is a powerful Java template engine. It can be used to generate basically anything, from HTML pages, configuration files, e-mails, or anything else. All you need to do is define your template, use Java to prepare the data, and use the Freemarker engine to process your data with the given template to produce the […]
Java NullPointerException – examples, causes and fixes
Probably one of the most common and annoying exceptions to be encountered by any Java developer is the dreaded “NullPointerException”. A null pointer exception is thrown when an “illegal” referencing of a null object is performed. A “null” object is an object which is not initialized. Let us explore some examples of how a null […]
How to install Maven 3.5.x on Windows
In the following article, we will find out how to install Apache Maven on Windows. We will be using Windows 8.1 and Maven 3.5.4 in this guide, but the instructions should also be valid for other software versions. Before we start, make sure that you have JDK installed properly on your machine. Next, we will […]