Tag Archives: Spring Boot

Spring Boot β€” convention-over-configuration framework for building Spring-based Java applications

Modern Java Testing: JUnit 6 + AssertJ + Mockito 5 + Testcontainers

JUnit 6 is the first major JUnit release built for Java 17+ and the virtual-thread era. But JUnit alone is only the runner β€” modern Java test suites pair it with AssertJ for fluent assertions, Mockito 5 for mocking, and Testcontainers for real infrastructure in integration tests. This post ties all four together into a complete, runnable example you can drop into any Spring Boot or plain-Java project.

Continue reading Modern Java Testing: JUnit 6 + AssertJ + Mockito 5 + Testcontainers

AI Prompts Playbook: Upgrading Java 8 β†’ 11 β†’ 17 β†’ 21 β†’ 25

Most Java codebases in production today are still on Java 8, 11, or 17. Upgrading captures years of ecosystem improvements β€” but the work is tedious, repetitive, and easy to get wrong. This post is a copy-paste playbook of AI prompts (works in Claude, ChatGPT, Gemini, or Cursor) that take you stage-by-stage through every LTS jump: 8β†’11, 11β†’17, 17β†’21, and 21β†’25. Each prompt is described so you know exactly what it does and when to reach for it.

Continue reading AI Prompts Playbook: Upgrading Java 8 β†’ 11 β†’ 17 β†’ 21 β†’ 25

Set Up RMI and Hessian Remoting in Spring Boot 2

Java RMI and the Hessian binary web-service format are considered legacy remoting protocols, but they still appear in enterprise codebases that predate REST or in environments where binary efficiency matters more than interoperability. Spring Boot 2 makes both trivially easy to configure through dedicated exporter beans β€” no XML, no servlet configuration, just a few @Bean declarations. This guide shows you how to expose and consume a service over both protocols with the minimal possible code.

Continue reading Set Up RMI and Hessian Remoting in Spring Boot 2

Solving NotYetImplementedException with Native Queries in Spring Boot JPA/Hibernate

If you have ever tried to project only a subset of columns from a native SQL query in Spring Boot with Hibernate, you may have encountered this cryptic error: org.hibernate.query.sqm.internal.SqmUtil$NotYetImplementedException or Pure native scalar queries are not yet supported. It is one of the more confusing Hibernate error messages because the fix is not obvious from the stack trace. This post explains exactly what causes it, shows you three clean solutions, and recommends the right approach for each scenario.

Continue reading Solving NotYetImplementedException with Native Queries in Spring Boot JPA/Hibernate

Packaging Java Apps: Fat JAR with Shade Plugin vs Spring Boot JAR vs jpackage

Distributing a Java application means choosing how to package it. Should you produce a thin JAR and let users manage the classpath? An ΓΌber JAR (fat JAR) with all dependencies bundled in? A native installer via jpackage? Each approach has a place, and understanding all three lets you pick the right one for every deployment scenario β€” from a developer tool shipped on Maven Central to a desktop app distributed to non-technical users.

Continue reading Packaging Java Apps: Fat JAR with Shade Plugin vs Spring Boot JAR vs jpackage

Creating Spring Beans with Static Factory Methods

Spring beans are most commonly created through constructors or @Bean factory methods, but there is a third, lesser-known option: static factory methods. When a class uses the factory pattern to control its own instantiation β€” for example, a connection pool, a registry, or a singleton that validates its configuration at construction time β€” a static factory method lets Spring call that factory instead of a constructor. This keeps your code idiomatic and avoids adding unnecessary public constructors just to satisfy the IoC container.

Continue reading Creating Spring Beans with Static Factory Methods

Top 40 Spring MVC Interview Questions and Answers (2025)

Spring MVC is the foundational web layer of the Spring Framework, and it remains a favourite topic in Java developer interviews at every level. Even in a world dominated by Spring Boot auto-configuration, interviewers probe Spring MVC knowledge to gauge whether a candidate truly understands what happens under the hood. This guide covers the 40 most-asked Spring MVC interview questions, organised from core concepts through advanced topics, each with a concise, interview-ready answer.

Continue reading Top 40 Spring MVC Interview Questions and Answers (2025)