Troubleshooting Articles
9 articles about Troubleshooting. Explore Spring Boot implementation, design, and operations across related topics.
-
How to Detect and Debug HikariCP Connection Leaks in Spring Boot - leakDetectionThreshold and Thread Dump Analysis
This article walks through diagnosing the symptom of HikariCP's active connection count steadily increasing and exhausting over time, covering leakDetectionThreshold configuration, how to read the warning logs, pinpointing the leak location by cross-referencing thread dumps, and fixing it with try-with-resources.
-
How to Fix NoSuchBeanDefinitionException with @ComponentScan in Spring Boot - Configuring Multi-Module Setups and Scan Scope
This article diagnoses why a Bean placed in a different package or module fails to be registered, resulting in NoSuchBeanDefinitionException, and explains pattern-by-pattern solutions using scanBasePackages, explicit @ComponentScan, and multi-module configurations.
-
How to Retrieve the Auto-Generated ID (AUTO_INCREMENT) After INSERT with Spring Boot + MyBatis
This article explains how to reflect the AUTO_INCREMENT/IDENTITY value generated by the DB after an INSERT in MyBatis back into your Java entity, covering both the annotation-based approach and the XML-based approach. It also introduces an alternative implementation using selectKey, and how to diagnose the typical causes when the ID comes back as 0/null.
-
How to Fix "Validate failed" / "checksum mismatch" in Spring Boot + Flyway - flyway repair and Production Recovery Steps
Explains the recovery steps for a Spring Boot app that fails to start due to Flyway's Validate failed: Detected failed migration or checksum mismatch errors. Covers the correct usage of flyway repair, why it should not be run carelessly in production, and manual fixes to the flyway_schema_history table, organized in a reverse-lookup format.
-
Spring Boot + MyBatis: Causes and Fixes for "Invalid bound statement (not found)" and "Parameter 'xxx' not found"
A step-by-step guide to diagnosing and fixing BindingException (Invalid bound statement (not found) / Parameter 'name' not found) and missing Mapper bean errors in Spring Boot 3.x + MyBatis, working through mapper-locations, namespace, @Param, -parameters, and @MapperScan in order.
-
Causes and Fixes for HikariCP "Failed to validate connection" and "Connection is closed" in Spring Boot - How to Decide maxLifetime and keepaliveTime
Learn how to isolate HikariCP "Failed to validate connection" and "Connection is closed" errors by pool stage, how to derive maxLifetime and keepaliveTime from DB and network timeouts, and how to diagnose why the pool does not recover after a DB restart.
-
Why @Transactional, @Cacheable, and @Async Don't Work in Spring Boot - Understanding AOP Proxies and Self-Invocation to Fix It
@Transactional doesn't roll back, @Cacheable hits the DB every time, @Async runs synchronously. All of these are caused by how Spring AOP proxies work. This article isolates five patterns - self-invocation, private/final methods, new, and missing enablement - with reproducible code and diagnostic steps, then compares workarounds such as extracting to a separate Bean, self-injection, and TransactionTemplate.
-
How to Fix LazyInitializationException in Spring Boot + JPA - Causes and Solutions for "could not initialize proxy - no Session"
Solve the LazyInitializationException (could not initialize proxy - no Session) that crashes the moment you access a lazily-loaded association in Spring Data JPA, working backwards from how Hibernate sessions and transaction boundaries operate. Compares the four proper approaches—JOIN FETCH, @EntityGraph, DTO projection, and @Transactional—and provides criteria for making decisions without resorting to open-in-view=true or switching to EAGER.
-
Spring Boot Application Won't Start? How to Isolate the Cause and Fix It
For anyone panicking at 'APPLICATION FAILED TO START'. Targeting Spring Boot 3.x, this guide walks through 7 typical patterns, including port conflicts, duplicate Beans, circular references, missing DataSource configuration, and profile mistakes, using a symptom-first reverse lookup. It also covers how to read FailureAnalyzer messages and how to use the --debug flag, with real examples.