
Fix Spring Security 401 Unauthorized Responses in APIs
Fix a 401 Unauthorized from Spring Security by checking credentials, the Authorization header format, token validation settings and filter order.
Everything you need to level up your coding skills.

Fix a 401 Unauthorized from Spring Security by checking credentials, the Authorization header format, token validation settings and filter order.

Shut down a Java ExecutorService properly with shutdown, awaitTermination and shutdownNow, handle interrupts, and avoid thread leaks in web apps and tests.

Understand Jakarta Security: HttpAuthenticationMechanism, IdentityStore, form and OpenID Connect login, role checks with RolesAllowed and the SecurityContext.

Write property based tests with jqwik: generators, shrinking, custom arbitraries for domain objects, round trip properties and seeds.

Size the Java heap in a container from measured numbers: live set after GC, non heap memory, the container limit and MaxRAMPercentage.

Fix Read timed out errors between Spring services by setting connect and read timeouts on RestClient and Feign, sizing pools and finding the slow side.

Write Quarkus tests with @QuarkusTest: how the application boots once per run, REST Assured, injecting beans, test profiles, resources and continuous testing.

Secure a JSF app with Jakarta Security: form authentication, an identity store, role rules in web.xml and EL, CSRF protection and session cookie settings.

Feed multi parameter tests in JUnit with MethodSource, CsvSource, CsvFileSource and ArgumentsSource, and choose the one that keeps test data readable.

Use Arthas to diagnose a running JVM without restarting it: attach, find hot threads, trace slow methods, watch arguments and decompile loaded classes safely.

Move a Struts application to Spring MVC one URL at a time: add Spring beside Struts, route by path, port actions, share services and retire Struts.

Migrate a Play 2.8 application to Play 3: go through 2.9 first, update sbt and Java, swap Akka for Pekko, fix removed APIs and verify before deploying.
We send one email when a new post is published. No spam.