Top 5 Spring Cloud Annotations for Java Microservices

Hello guys, If you are developing a Java application for Cloud, then you should learn Spring Cloud, a great framework and extension of the popular Spring framework, which can help you to develop a cloud-native Java application. Spring Cloud provides several necessary services required for a cloud-based Java application and Microservices like configuration management, service discovery, circuit breakers, intelligent routing, micro-proxy, a control bus, one-time tokens, global locks, leadership election, distributed sessions, cluster state, etc.

What is ContextLoaderListener in Spring MVC? Example Tutorial

The ContextLoaderListner is one of the essential components of the Spring MVC framework, probably the most important after the DispatcherServlet itself. It is used to create the root context and responsible for loading beans, which are shared by multiple DispatcherServlet like beans related to the service layer and data access layer. In general, When you develop Spring MVC based web applications and also using Spring in the services layer, you need to provide two application-contexts. The first one is configured using ContextLoaderListener, and the other is set using DispatcherServlet. The DispatcherServlet is responsible for loading web component-specific beans like controllers, view resolvers, and handler mappings while, as I said before, ContextLoaderListener is accountable for loading middle-tier and data-tier beans which forms the back end of Spring applications.

How to enable HTTP Caching in Java Web application with Spring MVC? Cache-Control Header Example

One of the standard requirement in a secure Java web application is to disallow the back button of the browser or invalid the session if the user hit the back button of the browser. You might have seen this behavior while doing online banking or net banking, almost all the banks don't allow you to use the browser's back button. Your session gets terminated as soon as you hit the back button, and you have to log in again to do any transaction. Btw, have you ever checked some situations on your Servlet and JSP-based Java web application, like, if you pressed the back button of your browser after logging in, what happened? You will find that the browser takes you to the previous page.

What is @PropertySource Annotation in Java and Spring? PropertySource Example Spring Boot

Hello Java developers, if you are using Spring Framework or Spring Boot in your new project and wondering what is property source in Spring Framework and how to use @PropertySource annotation then you have come to the right place. Earlier, I have shared the best books and online courses to learn Spring Framework and in this article, I will teach you how to use @PropertySource annotation in Spring to read Environment variables and inject properties using @Value annotation. In the Spring application, one of the files that are needed to provide properties to the Spring environment is the @Configuration classes. 

How @Configuration, @Component, and @ComponentScan annotations works in Spring Framework? Component Scanning Example

Hello guys, if you are wondering how to does autowiring work in Spring Framework and how does Spring Framework find dependency in runtime then you have come to the right place. Earlier, I have explained How Spring MVC works and how Spring Security works, and In this tutorial, I will tell you how component scanning and auto-wiring works in Spring. You will also learn how to enable component scanning in a Spring application. When you develop a software application using spring, you need to tell the Spring framework where to look for Spring components. Using component scanning it is very much easier as this enables auto-detection of beans by spring container and smoothly.

How to send Email in Java using Spring Framework? JavaMailSenderImpl Example Tutorial

Hello guys, if you want to send emails from your Java application and looking for a Java + Spring Framework tutorial to send emails then you have come to the right place. Earlier, I have shared the free spring framework online courses, and today, I am going to share how to send Emails in the Java application using Spring Framework and JavaMailSenderImpl class which makes it really easy to send emails from Java application.  Email is one of the essential function of any enterprise Java application. Your application will need Email functionality to send reminders, bills, payments, confirmations, passwords, alerts, and several other kinds of system notifications.

How does HTTP Request is handled in Spring MVC? DispatcherServlet Example Tutorial

One of the common interview questions in Spring MVC is, how does the DispatcherServlet process a request in Spring MVC? or What is the role of DispatcherServlet in the Spring MVC framework? This is an excellent question for any Java or Spring web developer because it exposed the candidate's knowledge about Spring MVC architecture and how its main components like Model, View, and Controller.   The answers to this question show how much you know about the Spring MVC framework and its working. 

[Solved] java.lang.ClassNotFoundException: org.Springframework.Web.Context.ContextLoaderListener in Java and Spring

Problem : You are getting java.lang.ClassNotFoundException : org.Springframework.Web.
Context.ContextLoaderListener in your Spring-based Java Web application.
Cause: This error comes when you are using the Spring MVC framework in your Java Web application and configured org.springframework.web.context.ContextLoaderListener as a listener in your deployment descriptor also known as web.xml, but the JAR which contains this class is not available in the web application's CLASSPATH.

How to fix org.springframework.beans.factory.BeanCreationException: Error creating bean with name X [Java Spring]

If you are using the Spring framework in your Java application and getting this error during startup it means Spring is not able to initialize the bean X and add it into its application context, Why? There could be multiple reasons like a typo on the spring bean name. Let's take a closer look at the stack trace to find out the real reason:

BeanInstantiationException: Could not instantiate bean class [X]: No default constructor found; nested exception is java.lang.NoSuchMethodException: X.()

Here X is the class, which is declared as Spring bean. The error clearly says that the default constructor is not present in class X.

What is the use of DispatcherServlet in Spring MVC? Interview Question Example

Hello guys, In today's article we are going to discuss one interesting and the important Spring MVC concept, which is also a popular Spring Interview question. How DispatcherServlet works internally in Spring MVC or What is the role of DispatcherServlet in Spring MVC are some of the frequently asked Spring MVC Interview Questions. You might have seen them already during your previous Java web development interviews but if you have not, it's a good question to know. In this article, I'll answer these questions by explaining What is DispatcherServlet and its importance in Spring MVC. The DispatcherServlet is one of the important components of the Spring MVC web framework and acts as a Front Controller.

What is @Bean Annotation in Spring Framework? Example Tutorial

Hello Java programmers, if you are wondering what is @Bean annotation in Spring Framework, what is the purpose, and how to use it then you have come to the right place. Earlier, I have shared the best free Spring core and spring MVC courses and In this tutorial, you will learn the most frequently used Spring annotations @Bean, which are used to define different types of beans. Beans are the fundamentals of Spring framework, they represent the POJO class which is created and managed by Spring Framework. Whole Spring framework is about beans and their relationships. 

Spring HelloWorld Example in Java Annotations and Autowiring [Tutorial]

Spring framework has gone a couple of releases since I last share the Spring hello world example with XML configuration. In this article, I am going to explain to you how to create a Spring hello world example with Spring 4.2 release and by using Annotation for dependency injection and autowiring. So no more XML files to specify bean dependencies. It's a simple program that shows how you can use the Spring framework to create Services that are loosely coupled. The example will show you the basic concept of dependency injection by creating a simple Java application that greets the user.

How to use @ResponseBody and @RequestBody in Spring MVC and REST? Example Tutorial

Hello guys, if you are wondering what is @RequestBody and @ResponseBody annotation in Spring MVC and Spring Boot then you have come to the right place. Earlier, I have told you about the @RestController annotation and in this article, I am going to explain to you what is RequestBody and ResponseBody annotation, how to use them, and when to use them with simple examples. While working with REST API, we may need to bind HTTP requests and response bodies with the domain object. To bind this, we use we can use the @ResponseBody and @RequestBody annotations in Spring MVC. 

Top 5 Free & Paid Spring Certification Courses and Practice Tests

Many Java developers don't know that, similar to Oracle's Java certification, there is also a Spring certification program, which certifies yourself for your Spring framework skill. There are three Spring certifications currently available, the Spring Professional certification exam, also known as the Vmware Certified Spring Professional exam (VMware EDU-1202) which certifies on your general knowledge about Spring framework, Spring MVC skill, Spring Boot, Spring Data JPA, Testing with Spring and Spring Boot, and other advanced Spring skills. Earlier, SpringSource provides these certifications, but now they are provided by Vmware, the company behind the Spring framework.

How to Schedule Spring Professional Certification Exam (VMware EDU-1202) Online? [Guide]

Hello folks, even since Pivotal made the mandatory training optional for Spring certification, I have been writing a lot about Spring 5.0 Core Professional exam here. In the past, I have written about general preparation tips, books, coursesmock tests. So, after months of hard work and preparation, you are finally ready for the day. In order to schedule for the Spring certification exam, you first need to buy an exam voucher from Vmware's website. If you have taken their training course like the Core Spring training course, then you also receive a free voucher for 1 attempt.

How to test a Spring Boot application in Java? @SpringBootTest Example

Hello guys, if you are wondering how to test your Java + Spring Boot application then you are at the right place. Earlier, I have shared best Spring Boot Courses and Spring Boot + Microservice example and in this article, I will talk about how to test your Spring boot application, mainly about writing unit test and integration test for Java and Spring boot application. Unit testing and Integration testing are two skills which separates a normal developer from a professional Java developer and when it comes to testing Spring applications many Java developer doesn't really know how to do that. If you are new to Java and Spring development but keen to learn Unit testing both Java and Spring Boot application then you have come to the right place.

Top 7 Spring Boot Online Courses for Beginners in 2025 - Best of Lot [UPDATED]

Hello guys, if one of your goals is to learn Spring Boot in 2025, and I have started working towards it. As I have talked about my 3 point action plan to learn new technology, the first step is to attend some online courses and start building from that. If you are not sure what is Spring Boot and why should you learn Spring Boot, then let me tell you that it should be the first Java framework you should learn in 2025. The Spring Boot makes it really easy to work with the Spring framework by removing all the starting hurdles concerning setup and configuration. In one word, it makes it possible to write a Spring-based Java application and run them like core Java applications, like from the primary method.

How to solve java.lang.NoClassDefFoundError: org/springframework/beans/factory/SmartInitializingSingleton in Spring Boot [Solved]

Problem:
I was trying to run a HelloWorld program using Spring Boot when I got this error:

Exception in thread "main" java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration#propertySourcesPlaceholderConfigurer due to internal class not found. This can happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:52)
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:92)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:174)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:136)

Top 6 Udemy Courses to Learn Microservices with Java and Spring Boot in 2025 - Best of Lot

Hello guys, if you want to learn about Microservices architecture and how to create Microservices with Java using Spring Boot and Spring cloud framework and looking for the best online courses then you have come to the right place. Earlier, I have shared the best free Microservices courses for Java programmers and in this article, I am going to share the best online courses to learn Microservices with Java in 2025. Popularity of Cloud Computing has given an exponential rise to Microservices architecture because they go hand in hand. 

Top 5 Free Udemy Courses to Learn Microservices for Java Developers in 2025 - Best of Lot

Hello Java programmers, if you want to learn Microservice architecture and look for free Microservice resources like free online courses, you have come to the right place. Earlier, I have shared the best Microservice courses for Java programmers to build Microservice using Java and the Spring framework, and today, I will share some free courses to learn Microservice in Java using Spring Boot and the Spring Cloud framework. If you don't know, Microservices is a modern architecture that goes along nicely with cloud computing and makes deployment, scaling, and even development easier. 

Top 10 Free Udemy Courses to become Fullstack Java Developer in 2025 - Best of Lot

Hello guys, if you want to become a full-stack Java developer and are looking for free online Java Full-stack development courses to kickstart your career, you have come to the right place. Earlier, I have shared the best Java full-stack development courses, and today, I will share 10 of the free online courses you can join to become a full-stack Java developer. The long journey of becoming a full-stack Java developer is not easy. You need to know all the details, from the front end to the backend. Not only these, but you also need to know how things function in databases and connectivity.

Top 10 Projects You can Build to Learn Spring Boot in 2025

Hello guys, I have always said that there is no better way to learn anything then actually doing it and its 100% true for Spring Boot, one of the popular Framework for Java application Development. In my 20 years of experience, I have found that the best way to learn Java and Spring Boot is building projects. When you build project, common task surface them like creating a List or sorting a List and then you research and learn. Those learning stuck and make you better developer. Building project also have many advantage like it allows you to use a lot of technologies like Git, IntelliJIDEA, Hibernate, APIs etc together to build something which you can showcase to your potential employer. 

Difference between @GetMapping @PostMapping @PutMapping @DeleteMapping @PatchMapping

In the world of web development, the Spring Framework is widely known for its versatility and ease of use. It provides several annotations that simplify the process of handling HTTP requests and mapping them to specific methods in Spring controllers. Among these annotations, @GetMapping, @PostMapping, @PutMapping, @DeleteMapping, and @PatchMapping are some of the most commonly used ones. In this article, we will explore each of these annotations in detail, highlighting their purposes, differences, and providing examples to better understand their usage.

10 Code Review Best Practices Every Senior Developer Should Know (2025 Edition)

Hello guys, if you are doing software development then you may know that as engineering teams scale, code review becomes not just a quality gate, but also an opportunity for mentorship, knowledge sharing, and upholding long-term code health. But sloppy reviews, unclear feedback, or bottlenecks can erode morale and slow down delivery. Here are 10 best practices I’ve refined over years of reviewing code at scale — each backed by experience — and how modern AI tools like CodeRabbit.ai can turbocharge your review workflow when used responsibly.

Top 20 Microservices Interview Questions with Answers for Java Developers

Hello guys,  if you are preparing for Java interviews then preparing for Microservice architecture is a good decision but there are not many places where you can find Microservice interview questions, so I thought to share some common Microservices questions from Java interviews. If you are a regular reader then you may know that I have been sharing spring interview questions regularly like I shared spring boot questions last year and this year, I have shared spring cloud questions and spring data jpa questions so far. You can use those articles to prepare well for any Java and Spring boot interviews, but I also suggest spending some time learning core spring concepts as those are very important.

How to Build Event-Driven Microservices with Spring Boot and Kafka? Example Tutorial

Event-driven microservices have gained immense popularity in modern software development due to their scalability, flexibility, and robustness. Leveraging technologies like Spring Boot and Kafka, developers can build highly responsive and loosely coupled systems. In this article, we will explore the fundamentals of event-driven microservices, using Spring Boot and Kafka, and finally, create a Java program that demonstrates the integration of these technologies using a real-world example.But, before we dive into the code. It’s very important to have a thorough understanding of the key terms. Let go through it one by one.

13 Spring Boot Actuator Interview Questions Answers for 5 Years Experienced

If you have used Spring Boot, you may know that Spring Boot is all about convenience, and the Spring Boot actuator is one of such features that provides a convenient way to interact with your app using HTTP and JMX. It's also essential from the Spring Boot interview point of view. While I did include some Spring Boot Actuator questions in my earlier post about frequently sked Spring boot interview questions, many of you asked for more questions to cover Spring Boot Actuator in depth, so I decided to write a separate article. In this article, we will see some popular Spring boot Actuator interview questions and, along the way, learn more about this helpful Spring boot Feature

Difference between Spring vs SpringBoot Framework in Java

Hello guys, if you have been doing Java development then you would have definitely come across both Spring and Spring Boot framework These two Java frameworks have taken the software development world by storm and have become the go-to tools for building all kinds of applications. But what exactly are Spring and Spring Boot, and how do they differ from one another? This is one of the common questions which many Java programmer ask, particularly those who are starting with software development or new to Java world. In the past, I have shared several Spring and Spring boot articles, courses, books, projects, and interview questions but in this article, I am going to answer what exactly is Spring and Spring Boot and what is the difference between them? This will also help you to decide  when to use Spring Framework or Spring Boot for Java application development. 

How to access configuration values from application.properties file in Spring Boot? Example Tutorial

Hello guys, if you are wondering how to access a value defined in your spring application configuration file then you are not alone, many Java developer face the same challenge. How to access a value defined in the application.properties file in Spring Boot is a common question that arises when you dealing with large software applications. In software applications, you need to have different environments for the QA, production, and local. So as a solution for this, you can use different configurations and update the files separately without affecting other environments by using property files.

How to Accept and Produce JSON as a response in Spring Boot? Example Tutorial

Hello everyone, welcome to the blog post. In this short tutorial, we are going to take an in-depth look at how to consume and produce JSON responses using a widely appreciated Java framework i.e. Spring Boot. As we all know Spring Boot is a framework designed to build a secure web application, microservice, REST API, and production-ready spring application. Modern-day application deals in a large amount of data, which they share in JSON format. A JSON is a standard plain text-based representation of structured data. It is one of the popular formats for data transmission over the internet. Due to its user-friendly syntax and lightweight, it helps in the process faster. 

How to configure multiple data sources in Spring Boot? Example Tutorial

Spring Boot is a popular framework for building Java applications that simplifies the development process. In some scenarios, you may need to work with multiple databases or data sources in your Spring Boot application. Earlier, we have seen how to change port of spring boot application and in this article will guide you through the process of configuring and using two data sources in Spring Boot. We will explore various approaches and provide practical examples to help you effectively manage multiple data sources in your application.

How to Configure CORS in a Spring Boot + Spring Security application

Cross-Origin Resource Sharing (CORS) is an essential mechanism for controlling access to web resources across different domains. When developing a Spring Boot application with Spring Security, it is crucial to configure CORS properly to allow or restrict cross-origin requests based on security requirements. In this article, we will explore how to configure CORS in a Spring Boot + Spring Security application, ensuring secure and controlled access to resources. We will provide step-by-step instructions and relevant code examples to help you implement CORS effectively.

Difference between application.properties vs Application.json vs Application.yml in Spring Boot

Hello guys, if you have worked in any Spring Boot application then you may have noticed that there are multiple ways to declare configuration for Spring Boot application. I am sure you must have noticed application.propties, application.json, and application.yml while working in proprietary or open source Spring Boot application. When I first started, it was application.propties and it was quite familiar because I have used properties file in past for specify configuration of Java application but when I first see applcation.json and application.yml I was bit confused like what they are and does they really work? In the end I found out that they are just different ways to specify configuration for any Spring Boot application. 

Difference between Spring Boot vs Spring Cloud in Java

Hello guys, if you are wondering, what is difference between Spring Boot and Spring Cloud then you re not alone. Many Java developer are not familiar with various spring boot projects like Spring Security, Spring Data JPA, Spring Batch, Spring Boot, Spring Cloud etc and this lack of knowledge prevent them from taking full advantage of Spring Framework.  In last article, I have explained difference between Spring framework and Spring Boot and in this article we are going to discuss the difference between Spring Boot and Spring Cloud. Before we dive into the difference between the two terms. Let us take a look at different terms like Spring, Spring Boot, and Spring Cloud.

How to Handle REST exception in Spring Boot Application? Example Tutorial

Hello everyone, in this article we are going to take a look at how to handle REST API exceptions in Spring Boot. It is crucial to handle errors correctly in APIs by displaying meaningful messages as it helps API clients to address problems easily. What happens if we don’t handle the errors manually? By default, the spring application throws a stack trace, which is difficult to understand. Stack traces are mainly for developers hence it is useless for API clients. That's why its very important to use proper HTTP code and error messages to convey errors and exception to client and also logging so that support team can better handle them. Ideally you should tell what went wrong and how to fix it? For example, if the error is due to duplicate data then clearly say, already existed, try with a new one. Similarly, if authentication fail then clearly say authentication failed instead of throwing some other exception. 

How to set base URL for REST in Spring Boot? Example Tutorial

Hello guys, if you are wondering how to set base URL for REST API in Spring Boot then you have come to the right place. Earlier, I have shared best REST API Courses for Java developers, REST API Books,  and a complete guide to create RESTful Web service using Spring Boot, in this article, I will show you how to set a base URL in any spring boot application? If you don't know what is a base URL in a REST application or website, let me give you a brief overview first.  A base URL is the continuous element of your REST API or website's address. For example, you'll notice that the address portion http://twitter.com displays in the address bar whenever you log on to your Twitter account or visit a Twitter profile from your computer. This is the primary or base URL.

How to Enable Disable Spring Security in Spring Boot? Example Tutorial

Hello guys, if you are wondering how to enable and disable Spring Security in a Spring Boot based Java application then you have come to the right place. In the past, I have shared best Spring security courses25 Spring Security questions, as well multiple Spring security tutorials like how to use HTTP Basic auth in Spring Security etc.  and in this article, I will share multiple ways to enable and disable Spring Security in a Spring boot application. But, before that, if you are new to Spring Security then find out what is Spring Security and how does it work?  At its core, Spring Security is simply a bunch of servlet filters that assist you with adding authentication and authorization to your web application. 

Top 5 Spring Boot 3 Features for Java Developers

Hello guys, if you want to learn Spring Boot 3 and wondering which features to start with then you have come to the right place. Earlier, I have shared 5 worth learning features from Spring Framework 6 and in this article, I am going to share 5 Spring Boot 3 features which are worth knowing and learning for every Java developer But, before we get to the best 5 features that you definitely need to check out in Spring Boot 3, let me tell you a bit about what Spring really is. Spring is basically a framework that can be used for developing various types of applications with the help of Java platforms. It also provides support for the Plain Old Java Objects, also known as POJOs, that developers can use for easily creating the Java SE Programming Model with full and partial Java EE.

How to do Integration Testing in Spring Framework? @SpringBootTest Example Java

Hello guys, if you are wondering how to test your Spring Boot application then you have come to the right place. Earlier, I have shared popular Spring Boot Testing Interview Questions and Spring Security Interview Questions and In this article, I will show you examples to test your Spring Boot application using @SpringBootTest annotation, which allows you to write Integration tests. When I talk about spring boot integration testing, I am talking about launching an application in ApplicationContext and performing tests. For integration testing, Spring Framework has a specific test module. It's referred to as a spring test. If we're going to utilize spring-boot, we'll need to use spring-boot-starter-test, which uses spring-test and other dependencies inside.

5 Essential Spring Boot Annotations with Examples in Java - Tutorial

Hello guys, if you are coding in Java for long then you know that Annotations have completely changed the way you write Java code. It's now impossible to write any Java code without using annotations but that's for good. They provide a lot of value and that's why it's important for a Java developer to get familiar with essential annotations of the framework he or she is using. When I think about Java, some of the essential annotations which come to our mind are @Override, @SuppressWarning, and @Deprecated. Similarly, if you are using the Spring Boot framework, an extension of the Spring framework which aims to simplify the Java development with Spring, you will often end up using a couple of annotations like @SpringBootApplication or @EnableAutoConfiguration.

How to upload a file and JSON data in Postman? Example Tutorial

How to upload a file and JSON data in Postman is a common question when you are dealing with REST APIs. In order to do this, you need to send through POST request. So in this article, we are going to explain this using different examples where you can upload a single file in different ways. upload a list of files, upload as an object or upload a list of objects containing images from postman. So before moving to the following different aspects of uploading a single file in different ways, let's assume that in your postman, you are using header named "Content-Type" with the value of "multipart/form-data".

Spring Boot Backend + Vuejs Example [Java tutorial] - Part 1

In this tutorial, we will show you the Vue.js HTTP client and Spring Boot Server example that uses Spring JPA to do the CRUD with the H2 database and Vue.js as frontend technology to make requests and receive responses. But before moving to the Spring Boot and VueJs Example, Let's discuss what is Vuejs and its use cases.

Top 5 Spring 6 New Features Java Developer Should Learn

Hello guys, if you are wondering what is New in Spring Framework 6 release and what new feature it has got or what does it support now then you have come to the right place. In this article, I will share 5 key changes from Spring Framework 6 which are worth knowing for Every Java developer. Before we get to the top 5 features of Spring that you need to definitely learn, let me tell you a bit more about what Spring Framework really is. Spring is basically a framework that can be used for developing various types of applications with the help of Java platforms. It also provides support for the Plain Old Java Objects, also known as POJOs, that developers can use for easily creating the Java SE Programming Model with full and partial Java EE.

Java + Spring Boot + Microservices Example - Step by Step Guide

Hello guys, if you are wondering how to create a Microservice in Java and Spring Boot then you are at the right place. In the past, I have shared best Spring Boot courses for Microservices, Interview Questions as well as essential Microservice design principles and patterns like API Gateway, Circuit breaker, CQRS, Event sourcing etc and In this article, we will cover the fundamentals of microservices with Spring Boot utilizing Spring cloud. We will cover a few fundamental ideas and then we will make a little microservices to give you an outline. I will also share step by step guide to make Microservices in Java and then deploy them using Docker and Kubernetes on Cloud. 

Top 5 Courses to Learn Amazon Affiliate Program in 2025 - Best of Lot

Hello guys, if you want to learn about Amazon's affiliate program and how to make money from that then you have come to the right place. But, before we get to the 5 best courses that will teach you everything you need to know about the Amazon Affiliate Program, let me tell you a bit more about what it really is. The Amazon Affiliate Program is basically a very easy way to monetize your website or blog. It is also known as Amazon Associates. 

You can easily sign up and get approved immediately. Then you can place Amazon affiliate links on your website. When someone clicks on that link and then buys something from Amazon, you will get a very good commission. It is really that simple.

How to fix cannot determine embedded database driver class for database type NONE

Hello and welcome to the blog post. Today we are going to take a look at a frequently encountered problem in Spring Boot Application. If you are reading this, I'm going to assume that you saw the problem "Cannot determine embedded database driver class for database type NONE" while executing a Spring Boot application. We will understand, when this error appears. For this we will create a simple Spring Boot project as shown below. It demonstrates how I encountered the problem "Cannot determine embedded database driver class for database type NONE".  

Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean

Hello and welcome to the blog post. In this post, we are about to take a look at how to fix the ‘unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean’ in the spring boot application. Let’s understand how to fix this error. But before we dig deep into this issue. Let’s first have a look at when this error appears. 


Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean

The error appears with the following stack trace.

Exception in thread “main” org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.

at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:140)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:476)

at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:124)

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:658)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:355)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:920)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:909)

at Application.main(Application.java:17)

Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.

at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:190)

at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:163)

at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137)

… 7 more 


Now, let's see some code to understand when this error comes and how to fix it:


SpringBootPracticeApplication.java


package com.practice.springboot;



import org.springframework.boot.SpringApplication;

import org.springframework.boot.autoconfigure.SpringBootConfiguration;



@SpringBootConfiguration

public class SpringBootPracticeApplication {



   public static void main(String[] args) {

      SpringApplication.run(SpringBootPracticeApplication.class, args);

   }



}



pom.xml


<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

   <modelVersion>4.0.0</modelVersion>

   <parent>

      <groupId>org.springframework.boot</groupId>

      <artifactId>spring-boot-starter-parent</artifactId>

      <version>3.0.4</version>

      <relativePath/> <!-- lookup parent from repository -->

   </parent>

   <groupId>com.practice</groupId>

   <artifactId>spring-boot</artifactId>

   <version>0.0.1-SNAPSHOT</version>

   <name>Spring Boot Practice</name>

   <description>Spring Boot Practice Project</description>

   <properties>

      <java.version>17</java.version>

   </properties>

   <dependencies>

      <dependency>

         <groupId>org.springframework.boot</groupId>

         <artifactId>spring-boot-starter-web</artifactId>

      </dependency>



	 <dependency>

       <groupId>org.springframework.boot</groupId>

         <artifactId>spring-boot-starter-test</artifactId>

         <scope>test</scope>

	</dependency>

   </dependencies>

</project>


As you can see from the above program, we have a very simple spring boot project that fails to run as intended. There are a couple of possible solutions to this program. These approaches are discussed below.


How to fix this error?

First of all you need to ensure that your main class has the @SpringBootApplication annotation.

The @SpringBootApplication annotation is comparable to the @EnableAutoConfiguration, @ComponentScan, and @Configuration annotations with their default properties, i.e., allow adding new beans to the context or importing more configuration classes.


SpringBootPracticeApplication.java -- updated

package com.practice.springboot;



import org.springframework.boot.SpringApplication;

import org.springframework.boot.autoconfigure.SpringBootApplication;



@SpringBootApplication

public class SpringBootPracticeApplication {



   public static void main(String[] args) {

      SpringApplication.run(SpringBootPracticeApplication.class, args);

   }



}


If you have followed the above step or your starter file already contains @SpringBootApplication, you need to make sure your pom.xml file also includes the spring-boot-starter-web or spring-boot-starter-tomcat dependencies, as demonstrated in the example below.
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

   <modelVersion>4.0.0</modelVersion>

   <parent>

      <groupId>org.springframework.boot</groupId>

      <artifactId>spring-boot-starter-parent</artifactId>

      <version>3.0.4</version>

      <relativePath/> <!-- lookup parent from repository -->

   </parent>

   <groupId>com.practice</groupId>

   <artifactId>spring-boot</artifactId>

   <version>0.0.1-SNAPSHOT</version>

   <name>Spring Boot Practice</name>

   <description>Spring Boot Practice Project</description>

   <properties>

      <java.version>17</java.version>

   </properties>

   <dependencies>

      <dependency>

         <groupId>org.springframework.boot</groupId>

         <artifactId>spring-boot-starter-web</artifactId>

      </dependency>



	 <dependency>

       <groupId>org.springframework.boot</groupId>

         <artifactId>spring-boot-starter-test</artifactId>

         <scope>test</scope>

	</dependency>



<!-- Add spring-boot-starter-web or spring-boot-starter-tomcat -->



<dependency>

    <groupId>org.springframework.boot</groupId>

    <artifactId>spring-boot-starter-tomcat</artifactId>

</dependency>



<!-- Add spring-boot-starter-web or spring-boot-starter-tomcat -->



   </dependencies>

</project>


After following the above two approaches, the error finally disappeared and the spring application start successfully as shown from the console.

 .   ____          _            __ _ _

 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \

( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \

 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )

  '  |____| .__|_| |_|_| |_\__, | / / / /

 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v3.0.4)


2023-03-09T09:46:05.540+05:00  INFO 40009 --- [           main] c.p.s.SpringBootPracticeApplication      : Starting SpringBootPracticeApplication using Java 19.0.1 with PID 40009 (/home/muhammad/IdeaProjects/spring-boot/target/classes started by muhammad in /home/muhammad/IdeaProjects/spring-boot)

2023-03-09T09:46:05.545+05:00  INFO 40009 --- [           main] c.p.s.SpringBootPracticeApplication      : No active profile set, falling back to 1 default profile: "default"

2023-03-09T09:46:06.501+05:00  INFO 40009 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)

2023-03-09T09:46:06.509+05:00  INFO 40009 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]

2023-03-09T09:46:06.510+05:00  INFO 40009 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.5]

2023-03-09T09:46:06.585+05:00  INFO 40009 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext

2023-03-09T09:46:06.585+05:00  INFO 40009 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 972 ms

2023-03-09T09:46:06.964+05:00  INFO 40009 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''

2023-03-09T09:46:06.972+05:00  INFO 40009 --- [           main] c.p.s.SpringBootPracticeApplication      : Started SpringBootPracticeApplication in 1.927 seconds (process running for 2.661)


Conclusion

That's all about how to fix "Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean" error in Spring Boot. . The main subject of this post is the Spring Boot problem Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean. 

We have explored two methods to address this issue. The first step is to choose the appropriate Spring annotation, and the second is to add the missing dependency to your build.gradle or pom.xml file. I hope the information in this post has helped you to correct the issue. For more such helpful articles keep following us.

Difference between Mockito.mock(), @Mock and @MockBean annotation in Spring Boot

Hello guys, if you are wondering what is the difference between Mockito.mock(), @Mock and @MockBean annotation in Spring Boot then you have come to the right place. In the Spring Boot framework, @Mock and @MockBean are both annotations used for creating mock objects in unit testing scenarios. However, they are used in different contexts and have some differences in their behavior which you will find in this article. In the past, I have shared difference between @Controller and @Service as well @RequestParam vs @PathVariable and in this article, I will explain the difference between @Mock and @MockBean annotations in Spring Boot. To be honest, I love this kind of questions as it not only help on interviews but also help to learn the concept better and you should also love them too.

How to fix access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set? [Solved]

Hello and welcome to the blog post. Today we are going to take a look at another frequently encountered issue while working with Spring Boot and Hibernate. The error "Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set" usually comes when Hibernate is unable to determine the appropriate database dialect to use. This error can be fixed by setting the hibernate.dialect property in your Hibernate configuration file. In this post, we'll look at a fix for the issue where a Spring Boot applications' "hibernate.dialect" setting prevents access to dialectresolutioninfo from being null., But before that let's take a look at the Exception itself.

How to Print SQL Statements in Spring Boot Application Log File? Example Tutorial

Hello guys if you are working on a Spring Boot application which loads and save data from database but you are not sure which queries are run on backend and you want to see them then you have come to the right place. Earlier, I have showed you how to set logging level in Spring Boot and In this article we are going to have a look at another very interesting topic from Spring Boot on how to log SQL statements in spring boot app. I know you might be wondering why I’m calling a very boring topic an interesting one? A proper logging is among one of the features that sets intermediate or experienced developers apart from beginners. 

Top 15 Spring Boot Interview Questions with Answers for Java/JEE Programmers

Hello guys, if you are preparing for your next Java interview and Job description mentioned about the Spring framework, then you should also prepare some Spring Boot interview questions to avoid disappointment. Spring Boot is now the standard way to use the Spring framework for Java development and almost all the companies are moving from the traditional way of using Spring Framework to a more modern Spring Boot way. Gone are the days, where questions like have you used Spring Boot " were asked to the developer. Nowadays interview expects more knowledge of Spring Boot from candidates and there are reasons for it, which we'll explore in this article.

How to setup Request timeout in Spring Boot REST API? Example Tutorial

Hello guys, if you are wondering how to setup request timeout in your REST API using Spring boot then you have come to the right place. First thing first, when you make a request to another API in production, you must add timeout as there is no guarantee that you will receive response in time. Today we are going to take a look at setting up request timeout in Spring Boot Rest API. Before making it into the topic. Let’s first understand a few terms here. What is a Request timeout? A Request timeout is a deadline for services to respond to requests. It ended up returning an error with status 504 if the request fail to respond within the specified time. Request timeouts can help prevent a bad user experience, especially when a request is taking a long to respond to. There are various ways to set request timeout in Spring Boot

How to Fix Consider defining a bean of type 'package' in your configuration [Solved]

Hello and welcome to another blog post. Today we are going to take a look at one of the most frequently appearing errors in the Spring Boot application. I’m sure most of us have faced a similar issue while working with the Spring Boot application, and the error is ‘consider defining a bean of type package in your configuration’. In general, The error "Consider defining a bean of type 'package' in your configuration" occurs when Spring Boot is unable to find a bean of a specific type that is required by your application. In this article, we will take an in-depth look at why this error appears in the first place. Moving ahead we will learn how to fix this issue. So without further ado let’s jump into it.

How to use Spring Boot and Thymyleaf in Java Web Application? Example Tutorial

Hello guys, if you are looking for a Spring Boot and Thymyleaf example, tutorial, or a project then you have come to the right place. Thymyleaf is one of the most popular, modern, server-side Java template engine to generate HTML and XHTML content. Earlier, I have shared Spring Boot + Reactjs project, as well a complete project to create Spring Boot + REST and Spring Boot + Microservices and in this tutorial, you will learn about how to create a spring boot and thyme leaf application using the h2 database.  So before moving to an example, let's discuss what is thymyleaf? Thymeleaf is a web application development library based on Java. It offers excellent support for providing XHTML/HTML5 in web applications.

How to read files from the resources folder in Spring Boot? Example Tutorial

Hello everyone, welcome to the blog post. In this article, we are going to take a look at a frequently asked question in spring boot on how to read files from the resources folder. A resource is any file that contains information relevant to your project, including configuration files, picture files, data files, or other types of files. In this article, we will look at various methods and techniques that both spring boot and ordinary Java code allow us to read a file from the resources directory. Our goal is not simply to list these approaches; rather, we will describe each strategy with the help of an example so that, everyone can easily grasp the topic. Without further ado, let's get started. 

10 Examples of WebClient In Spring Framework and Java

Hello guys, if you are wondering how to use WebClient on Spring Framework and looking for simple how to examples of WebClient then you have come to the right place. Earlier, I have shared 10 example of RestTemplate in Spring Framework and in this article, I Am going to share 10 example of WebClient in Spring. These examples covers everything from sending GET request to REST API and consuming response, and also sending POST, PUT, and PATCH request to RESTful Web Services. You will also learn how to set header like Basic Authentication and Authorization header, cookies and much more.  

How to Fix Spring Boot cannot access REST Controller on localhost (404) Error in Java

Hello guys, if you are getting "cannot access REST Controller on localhost (404)" error in your Spring Boot application and wondering how to solve it then you have come to the right place. Earlier, I have shared how to solved 5 common Spring Framework errors and exception and in this article, we will take a look at the spring boot can’t access rest controller on localhost (404) issue. A 404 Not Found Error for your REST Controllers is a relatively typical problem that many developers encounter while working with Spring Boot applications. In this Spring boot tutorial, let's explore why such an error took place, and later on, we will learn how to fix this issue.

Difference between @SpringBootApplication vs @EnableAutoConfiguration annotations in Spring Boot? Example

Even though both @SpringBootApplication and @EnableAutoConfiguration can be used to enable the auto-configuration feature of Spring Boot, there is a subtle difference between them. The @SpringBootApplication does much more than what @EnableAutoConfiguration does. It's actually a combination of three annotations: @Configuration, which is used in Java-based configuration on Spring framework, @ComponentScan to enable component scanning of components you write like @Controller classes, and @EnableAutoConfgiuration itself, which is used to allow for auto-configuration in Spring Boot application.

3 Ways to change Embedded Tomcat Server Port in Spring Boot Application - Example

If you know Spring Boot really simplifies the Java web development by embedding essential libraries as well as a tomcat server to run Java web applications. By default, this tomcat server listens on port 4588, and for any reason, if you want to change, then Spring boot provides several configuration options to achieve that. For example, I wanted tomcat to listen on port 8080 because port 80 is forwarded to 8080 in our Linux machine, and we wanted our clients to provide our client with a clean URL without a port.

How to set the logging level in Spring Boot application.properties - Example Tutorial

Hello guys, if you are wondering how to set the logging level on spring boot then you have come to the right place. In the past, I have shared the best Spring Boot courses and free courses to learn Spring MVC and in this article, I will share how to set logging levels like DEBUG and INFO in Spring Boot.  How do we configure the logging level of our Spring boot application is one of the questions that arise when developing a large application. Because we need to trace errors, warnings, informational data when running our application and to this, Spring has introduced Spring boot logging configurations. 

5 Free Oracle and Microsoft SQL Server Online Courses [2025] - Best of lot

If you are an application developer, like someone developing a server-side application using Java or .NET or any other programming language which uses a database like Oracle and Microsoft SQL Server or a junior DBA, then you must learn these database technologies to effectively work in your Job. Even though your organization might have DBAs or Database Administrators to help you with the database, more often than not, it's application developers who end up writing SQL scripts to create data, upload data, query data, and writing complex stored procedures and triggers to implement application functionalities. DBAs job mostly does database installation, access control, security, and other database admin stuff.

6 Best Free AZ-900 Azure Fundamentals Courses for Beginners to Learn Online in 2025

Hello guys, if you are preparing for the AZ-900 certification or Azure Fundamentals exam in 2025, one of the best certifications to start a cloud computing career, and looking for free online courses to start your preparation, then you have come to the right place. In the past, I have shared both free and paid courses to learn AWS, Azure, and Google Cloud and the best AZ-900 courses and practice tests, and today, I am going to share the best free AZ-900 courses to pass the Azure Fundamentals exam. If you are thinking of learning Cloud Computing and Microsoft Azure platform, this is the best cloud certification. 

Top 10 Free Python Programming Books - Download PDF or Read Online

Every Programmer loves free eBook and free courses, even more, if it comes from renowned technical book publishers like Oreilly and Manning. In the last article, I have shared some of the best free Java programming books, and today I am going to share some of the equally best free Python Programming books. These books are not illegal copies that are uploaded into the internet, but they are legal books, made free by their authors and publishers, much like free Udemy courses, which their instructor made free for educational and promotional reasons. Though these are not full-fledged books but concise eBooks, they are very informative and comprehensive enough to learn things like Data Science and Functional programming in Python.

8 Free Linux Courses for Programmers and IT Professionals to Learn Online [2025]

Linux is one of the most popular operating systems to run server-side applications. I have seen almost all Java applications running on Linux, barring a couple of them, which run on Windows as a service. If you take out standalone apps like IDEs or tools, most of the real-world Java applications run on Linux, like payment gateways, trading systems, and other financial applications. That's why it's essential for any programmer, IT professional, or developer to learn and understand Linux, both the operating system, as well as the command line.

Top 7 Free Amazon Web Services or AWS Courses to Learn in 2025- Best of Lot [UPDATED]

Hello guys, if you are thinking about learning cloud technologies or cloud computing, and looking at the various cloud providers like AWS, GCP, or Azure, then you are going in the right direction. The future lies with Cloud, and it's essential for every developer to learn about cloud computing solutions. When we talk about Cloud, the first thing that comes to mind is AWS, the biggest Cloud Computing platform, and that's why I suggest a lot of developers learn it. If you want to learn Amazon Web Services, popularly known as AWS, and looking for some excellent resources like books, courses, and tutorials, then you have come to the right place.

Top 10 Free Courses for Java Developers to Learn Online in 2025 - Best of Lot

Hello guys, the Internet is full of useful resources, and no matter what you want to learn, there is something useful available for free. You just need to commit your time and effort. But at the same time, it's challenging to choose from the massive sea of free tutorials and courses on the internet. If you are not careful, you will spend most of your time browsing and changing classes without learning anything. That's where a curated list helps. Curation is my hobby and passion. I love to read books and courses which allows me to curate useful resources and share them with you guys.

Top 6 Free Object-Oriented Programming Courses for Java Programmers in 2025 [UPDATED]

The OOP or Object Oriented Programming paradigm allows you to write a program by modeling real-world things in terms of class and object. It makes representing a real-world thing in the programming world smoother and will enable you to manage the complexity of your program. Even though several programming paradigms, like procedural and functional, most of the code we write today is object-oriented. Some of the most popular programming languages are object-oriented, like Java, Python, PHP, and JavaScript, all supported object-oriented programming.

3 ways to Learn Java Programming in 2025? Books, Courses, and Projects

Hello guys, if you want to learn Java and wondering what is the best way to learn Java in 2025 then you have come to the right place. In the past, I have shared many useful resources to learn Java programming and development like the 2025 Java Developer RoadMapbest Java coursesbest Java books, and this list of best websites to learn Java for FREE, and in this article, I will tell you the best way to learn Java in 2025. Learning Java programming is quite rewarding and I can say that it was my best decision to learn Java 20 years ago. It opens doors to many opportunities in software development and lucrative jobs like Java developers on Investment banks like JP Morgan, UBS, Citibank, Barclays, and more. 

Top 6 Docker Courses for Java and Microservices Developers in 2025 - Best of Lot

Hello Java programmer, if you want to learn Docker and looking for the best Docker Courses from Java and Spring Boot developer point of view, then you have come to the right place. Earlier, I shared free Spring Boot courses and Docker courses, and in this article, I will share the best Docker courses for Java and Spring developers. Java is one of the most popular and widely used programming languages. It is an evergreen programming language. For Java developers, Docker is a game-changer. Docker is emerging rapidly, and it's now one of the most essential tools for all kinds of programmers, and there are reasons for it like Docker makes both development and deployment easier. 

Top 35 Java String Interview Questions with Answers for 2 to 5 Years Experienced Programmers

Hello Java Programmers, if you are preparing for a Java developer interview and want to refresh your knowledge about  String class in Java then you have come to the right place. In the past, I have shared 130+ Core Java Interview Questions and 21 String Coding Problems for Interviews and in this article, I am going to share 35 Java String Questions for Interviews. The  String class and concept is a very important class in Java. There is not a single Java program out there which is not use String objects and that's why it's very important from the interview point of view as well. In this article, I am going to share 35 String-based questions from different Java interviews.

Top 53 Java Programs for Coding and Programming Interviews

Hello guys, if you are learning to code and programming, or preparing for a programming job interview and looking for some practice material then you have come to the right place. Earlier, I have shared the best string, array, linked list, and binary tree coding problems and In this article, I am going to share some of the most common Java coding and programming problems for beginners. These are the problems, I have solved myself to learn to program and develop a coding sense and these are the ones that keep coming on Java coding interviews. By going through these coding problems you will not only learn Java but also prepare yourself for Java interviews. 

10 Examples of Stream API in Java 8 - count + filter + map + distinct + collect() Examples

The Java 8 release of Java Programming language was a game-changer version. It not only provided some useful methods but totally changed the way you write programs in Java. The most significant change it brings in the mindset of Java developers was to think functional and supported that by providing critical features like lambda expression and Stream API, which takes advantage of parallel processing and functional operations like filter, map, flatMap, etc. Since then, a lot of Java developers are trying their hands to learn those significant changes like lambda expression, method reference, new Date and Time classes, and, more importantly, Stream API for bulk data operations.

How to debug Java 8 Stream Pipeline - peek() method Example Tutorial

Hello guys, I have been writing about some important methods from Java SE 8  like map(), flatMap(), collect(), etc for quite some time, and today I'll share my experience with another useful method peek() from java.utill.stream.Stream class. The peek() method of the Stream class can be very useful to debug and understand streams in Java 8. You can use the peek() method to see the elements as they flow from one step to another like when you use the filter() method for filtering, you can actually see how filtering is working like lazy evaluation as well as which elements are filtered.