Preparing for Java and Spring Boot Interview?

Join my Newsletter, its FREE

Wednesday, May 15, 2024

Top 9 Courses to Learn SQL and Database in 2024 - Best of Lot

Hello guys, if you are a computer science graduate or new to the programming world, interested in learning SQL, and looking for some excellent resources, like books, courses, and tutorials to start with, then you have come to the right place. In the past, I have shared some of the best SQL books and tutorials, and today I am going to share some of the best SQL and database courses to learn and master this useful technology. If you don't know what SQL is and why you should learn it, let me give you a brief overview of SQL for everyone's benefit. SQL is a programming language to work with a database. You can use SQL to create database objects, like tables, stored procedures, etc., and also to store and retrieve data from the database.

Top 8 Udemy Courses to Learn System Design and Software Architecture in 2024 - Best of Lot

Hello guys, if you want to learn Software Architecture and System design in 2024 and looking for best resources then you will be happy to know that  I am going to share  8 best Udemy courses to learn Software architecture and System design for 2024. if you are preparing for technical interviews for Software Engineering job then you may be aware of  Software Design or System design. It is one of the most important but at the same time very tough topic to master and many programmers even experienced developer struggle to solve System design problems during interview, particularly while interviewing with top tech companies like Google, Meta, Amazon, Apple, Microsoft, Netflix etc, popularly known as FAANG (now MAANG) since Facebook is now Meta. 

Top 5 Courses to Learn Hibernate and JPA in 2024 - Best of Lot

Hibernate is one of the essential frameworks for Java and Java EE or JEE programmers, especially if you are working on the server-side of a Java Web development project. It's an ORM tool or a framework that allows you to deal with only objects while Hibernate takes care of your data on your behalf. For example, instead of writing classes with SQL to load, save, and update data using the DAO design pattern, you can simply use the Hibernate framework in your project. It will allow you to deal with just objects while it will load, save, and update data in the background. It's also one of the top Java frameworks in my list of top 10 Java frameworks Programmers can learn.

Tuesday, May 14, 2024

Top 20 Spring and REST Interview Questions Answers for Java/JEE Programmers

Hello guys, I have been sharing a lot of REST with Spring tutorials from last a couple of weeks and today, I am going to share some of the frequently asked Spring and REST interview questions to Java developers applying for Web developer roles. Since Spring Framework is the most popular and the standard framework for developing Java web application and RESTful Web Services, a solid knowledge of Spring core and Spring MVC is expected from any senior Java developer, but if the job description mention about REST and Web Services, you also need to be aware of how to develop RESTful Web Services using Spring Framework?.

Monday, May 13, 2024

Top 5 Books to Learn Spring framework and Spring MVC for Java Programmers

Spring and Spring MVC is one of the most popular Java frameworks, and most of the new Java projects use Spring these days. Java programmer often asks questions like which books are good to learn Spring MVC or the best book to learn Spring framework etc. If you are looking for the best Spring Framework books, then you have come to the right place. Earlier, I shared the best Spring Framework courses and best Spring Boot courses, and in this article, I will share the best books to learn Spring Framework for Java developers. There are many books to learn Spring and Spring MVC, but only certain books can be considered good because of their content, examples, or how they explained the concept involved in the Spring framework. 

Sunday, May 12, 2024

How to POST JSON request from Linux to test RESTful Web Services? Example

Even though, Postman is a great tool and chrome plugin to test RESTful Web services for Java developers, I often find myself using "curl" or "cURL" command in Linux for testing RESTful Web Services, particularly Java web services built using Spring or Spring Boot framework. The curl command is easily available on most of Linux hosts and you just need to type a command to sent various types of HTTP requests to your application from Linux command line, as shown here. Though, many RESTful web developer and tester knows this trick, they mainly use GET request to access data from web service and  many of them struggle to send HTTP POST request containing JSON data to create new resources. 

Saturday, May 11, 2024

Role based Access control using Spring Security and MVC, Mapping LDAP Groups to Authorities for Authorization

Authentication and Authorization is an integral part of any Java enterprise or web application. Since most of the company uses LDAP Active directory for authentication, authorization, and Role-based access control (RBAC), it's good to know How to implement Role-based access control using Spring MVC and Spring Security. This is the second part of my articles on using Spring Security for authentication and authorization in Spring MVC based Java application. In the last part, we have learned about doing LDAP authentication against Windows active directory, and in this Spring Security tutorial, we will learn How to map LDAP groups to authorities for implementing Role-based access control or authorization.

Friday, May 10, 2024

3 ways to solve java.lang.NoClassDefFoundError in Java J2EE

I know how frustrating is to see "Exception in thread "main" java.lang.NoClassDefFoundError" while running your Java application. This is one of the dreaded problem in Java  which is also a manifestation of NoClassDefFoundError in Java. I have seen it a couple of times and spent quite a lot of time initially to figure out what is wrong, which class is missing etc. The first mistake I did was mingling java.lang.ClassNotfoundException and NoClassDefFoundError, in reality, are totally different, and my second mistake was using the trial and error method to solve this java.lang.NoClassDefFoundError instead of understanding why NoClassDefFoundError is coming, what is the real reason behind NoClassDefFoundError and how to resolve this.

10 Examples of JdbcTemplate in Spring Framework

Hello Java programmers, If you have been using the Spring framework then you may know that the JdbcTempalte is one of the most useful classes of the Spring framework. The JdbcTempalte class provides lots of convenient methods for performing database-related tasks that take the pain away from using the JDBC API. If you have worked in any real-life Java project which connects to a Database using JDBC then you know that JDBC API is not very convenient to use as it requires a lot of boilerplate code. For example, to execute a simple SELECT query, you first need to create a Connection and Statement object to execute the query and iterate through a ResultSet Object to get the result of the query. Finally, you need to close all of these resources to prevent resource leaks in Java.

How to Solve java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener in Spring? [Example]

If you have worked in Spring MVC then you may be familiar with  
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
which is common problem during deployment. Spring MVC throws  java.lang.ClassNotFoundException:                           org.springframework.web.context.ContextLoaderListener ,
when its not able to find org.springframework.web.context.ContextLoaderListener class which is used to load spring MVC configuration files like application-context.xml and other Spring Framework configuration files defined in context-param element of web.xml in an Spring MVC web application as:

Thursday, May 9, 2024

How to Consume JSON from RESTful Web Service and Convert to Java Object - Spring RestTemplate Example

So far, I have not written much about REST and RESTful web service, barring some interview questions like REST vs. SOAP, which is thankfully very much appreciated by my readers, and some general suggestions about the best books to learn REST and best REST courses in the past. Today I am going to write something about how to consume JSON from a RESTful Web Service in Java using Spring Framework? I will also talk about how to convert the JSON to Java objects using Jackson. You will also learn about the RESTTemplate class from the Spring MVC framework, and how you can use it to create a REST client in Java in just a few lines of code.

Wednesday, May 8, 2024

Spring Boot + Kafka Example (Single and Multiple Consumer) in Java

Hello guys, if you want to use Apache Kafka with Spring Framework or Spring Boot and looking for an example then you have come to the right place. In the past, I have shared the best Spring Boot courses as well as best Apache Kafka courses for Java developers, and in this article, I am going to share how to use Apache Kafka with Spring Boot. You will learn both, to publish and consume messages from Apache Kafka topics in your Spring boot application. By the way, if you don't know, Apache Kafka is an open-source stream-processing software platform developed by LinkedIn and later they donated to Apache software foundation, king of open source development in Java world. 

Monday, May 6, 2024

How to set an "Accept:" header on Spring RestTemplate request? Example Tutorial

Hello Java programmers, if you have been using Spring for REST API development, both creation and consumption then you know that RestTemplate is one of the most commonly used tools for REST service invocations. So one of the major problems you might have in this RestTemplate is that how to set an "Accept" header on Spring RestTemplate request.  In the last article, I have shown you how to POST and Consume JSON using RestTemplate in a Spring Based Java application and In this tutorial, we will go through some important points on how to add headers to RestTemplate and fix the errors related to them. 

Saturday, May 4, 2024

Top 133 Java Interview Questions Answers for 2 to 5 Years Experienced Programmers

Time is changing and so is Java interviews. Gone are the days, when knowing the difference between String and StringBuffer can help you to go through the second round of interview, questions are becoming more advanced and interviewers are asking more deep questions. When I started my career, questions like Vector vs Array and HashMap vs Hashtable were the most popular ones and just memorizing them gives you a good chance to do well in interviews, but not anymore. Nowadays, you will get questions from the areas where not many Java programmer looks e.g. NIO, patterns, sophisticated unit testing or those which are hard to master e.g. concurrency, algorithms, data structures and coding.

Top 22 Spring Interview Questions Answers for Java Programmers [UPDATED]

Hey Java Programmers, if you are preparing for a Java developer interview then you should pay special attention to Spring framework-related questions. Spring framework interview questions are on the rise on Java web development and core Java interviews.  This is obvious given Spring Framework is the best most popular framework available for Java application development and now Spring IOC container and Spring MVC framework are used as a de-facto framework for all new Java development. Because of its popularity,  interview questions from the spring framework are top on any list of Java Interview questions and you should also prepare different Spring topics like Spring Boot, Spring Data JPA, Spring Security, Testing and Spring Cloud, etc to do well on Java developer interviews.