How to deal with Whitelabel Error Page in Spring Boot Applications

In this tutorial I am going to discuss about what is Whitelabel Error Page and how to deal with Whitelabel Error Page in Spring Boot applications. Spring boot allows you to setup a Spring based application with minimal configurations. Spring MVC applications provide no default (fall-back) error page out of the box but Spring Boot based applications provide a fall-back…

Exception Handling in Spring Boot Application

Table of Contents Introduction Prerequisites Project Setup Entity Class Repository Interface Exception Classes Advice for Exception Spring REST Controller Spring Boot Main Class Testing Exception Handling Source Code Introduction This post will show you an example on exception handling in Spring web application. In other words, you can also say exception handling in Spring MVC. I will use handle exception…

org.hibernate.MappingException: No Dialect mapping for JDBC type

Introduction Here I am going to show you how to resolve issue org.hibernate.mapping.exception: No Dialect mapping for JDBC type that occurs in your Hibernate based application due to some types mismatch between database table column and Java field. You might have seen similar kind of exception occurred during performing native queries without entity class and this kind of issue may…

Junit Code Coverage with Jacoco

Introduction In this post I will show you how to work with Junit code coverage with JaCoCo code coverage library, which is quite a new maven plug-in that provides the JaCoCo runtime agent to your tests and allows basic report creation. Currently it supports instruction, branch, line, method and class coverage which is pretty enough you can expect from this…

Handling Default Exceptions in Mule

A catch exception strategy can be defined to customize the way Mule handles messages with errors. A catch exception strategy catches all exceptions thrown within its flow and processes them, thereby overriding Mule’s implicit default exception strategy. Mule’s catch exception strategy behavior is similar to a Java catch block, except that a new exception cannot be thrown or another exception…

Handling Global Exceptions in Mule

A catch exception strategy can be defined to customize the way Mule handles messages with errors. A catch exception strategy catches all exceptions thrown within its flow and processes them, thereby overriding Mule’s implicit default exception strategy. Mule’s catch exception strategy behavior is similar to a Java catch block, except that a new exception cannot be thrown or another exception…

Handling Local Exceptions in Mule

A catch exception strategy can be defined to customize the way Mule handles messages with errors. A catch exception strategy catches all exceptions thrown within its flow and processes them, thereby overriding Mule’s implicit default exception strategy. Mule’s catch exception strategy behavior is similar to a Java catch block, except that a new exception cannot be thrown or another exception…

Junit’s annotation based expected exception testing

Junit provides an option of tracing exception thrown by a Java method. There are different ways of handling exceptions in JUnit tests. Standard Junit’s org.junit.Test annotation offers expected attribute that allows you specifying the a Throwable to cause a test method to succeed if an exception of the specified class is thrown by the method. A Java unit test should…

Exception Handling Best Practices in Java

I am going to tell you what are the best practices for handling exceptions in Java applications. An exception is an event that occurs during the execution of a program that disrupts the normal flow of the program and the program terminates abnormally. Types of Exception – the exception can be either a checked exception or an unchecked exception.

SOAP Fault handling using Exception in JAX-WS webservice

This tutorial will show you how we can generate SOAP fault error code and message using Exception handling in SOAP based JAX-WS webservice. For this tutorial we will create a standalone project in Eclipse. If you already have an idea on how to create a maven project in Eclipse will be great otherwise I will tell you here how to…