javaspringexceptionuncaught-exceptionuncaughtexceptionhandler

Global error handling for spring standalone application


I have a standalone spring application where one of my bean implementing UncaughtExceptionHandler and in main method calling Thread.setUncaughtExceptionHandler. Is there any spring support for global error handling, I found a few options for spring MVC but not for Non-MVC / standalone.


Solution

  • Spring does not support global exception handler for standalone / non-mvc. As explained here you may need to implement it by defining jointpoint and pointcuts and enable pointcut for any "*Exception".