Announcement Announcement Module
No announcement yet.
Generic Exception Handling for "@Scheduled" Annotation. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Generic Exception Handling for "@Scheduled" Annotation.


    Any know the way to implement the generic exception handling ?

    For Example:

    public void firstJob(JobId jobId) {
    System.out.println("first job" + (10/0));

    In the above method with the "@Scheduled" and will throw "ArithmaticException".

    Here i want to log or write some information to the DB after exception thrown. I can have try catch block in each of the "Scheduled methods" but is there any way to handle these thing in generic way ? and also if the method runs successfully then also i will write some information to DB regarding this tasks.

    Thank You.

  • #2
    This question is probably a better candidate for StackOverflow, perhaps with the "spring" tag.

    Could you post your question there?
    The forums are moving to stackoverflow, a page explaining all this will be available there in a few days: