
Fix Deadlocks in Java With Thread Dumps and Lock Ordering
Recognize a Java deadlock in a thread dump, find the two locks and threads involved, and remove the cycle with lock ordering, timeouts or smaller locks.
Tag
77 posts

Recognize a Java deadlock in a thread dump, find the two locks and threads involved, and remove the cycle with lock ordering, timeouts or smaller locks.

Fix the Struts 2 missing result error by mapping the code the action returned, usually input after a validation failure, and checking the package.

Why changing a list inside a for-each loop throws ConcurrentModificationException, and the safe ways to remove, add or replace elements while iterating.

Fix Jackson's Unrecognized field not marked as ignorable error by deciding whether to accept unknown properties, rename a field or fix the client.

Fix the Maven and Gradle error about a missing main class by repackaging only the runnable module or by naming the main class explicitly.

Read a BeanCreationException trace to its root cause and fix the usual culprits: constructors that throw, bad schemas and absent services.

Fix RejectedExecutionException by telling a full queue from a shut down executor and choosing a pool size, queue bound and rejection policy on purpose.

Fix the JVM start-up error about reserving heap space by checking 32-bit JVMs, a heap larger than memory, container limits and fragmented address space.

Fix java.lang.OutOfMemoryError Java heap space by deciding whether the heap is too small or something is leaking, using a heap dump to tell the two apart.

Fix the Jackson error about Java 8 date/time types by registering the time module, choosing ISO strings over timestamps and setting the format in one place.

Find why a Java pod restarts in a loop by reading previous logs, exit codes and probe events, then fix OOM kills, bad config and probes that fire too early.

Why Hibernate throws StaleObjectStateException when two users edit one row, and how to handle it with versioning, retries or pessimistic locks.