Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6529825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:40:56+00:00 2026-05-25T09:40:56+00:00

In our code we have a number of processors that implement the same interface.

  • 0

In our code we have a number of processors that implement the same interface.
By using spring and some arguments in our code, we lookup the correct concrete implementation of the IMsgProcessorInbound class to call.

When an exception occurs in any of these concrete implementations, i would like to catch the expception in the below try catch block.

Unforunately, this try catch block is never entered when an exception is thrown in the concrete implementation.

Is there any way I can catch the exceptions in the catch block listed below instead of littering all my concrete implementations with exception handling code?
Or is there some error handling functionality that spring can provide me?

IMsgProcessorInbound msgProcessor = msgProcessorSelectorInbound.lookupProcessorInbound(args);


    try {
        msgProcessor.processMsg(fixProcessorArgs);
    } catch (Exception e) {
        log.error("Exception is: " + e);
    }

All help with this issue is greatly appreciated.

Thank you
Damien

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:40:56+00:00Added an answer on May 25, 2026 at 9:40 am

    Check this;

      try {
            msgProcessor.processMsg(fixProcessorArgs);
        } catch (Throwable e) {
            log.error("Exception is: " + e);
        }
    

    msgProcessor.processMsg() may not be throwing a type of Exception. The Throwable class is the superclass of all errors and exceptions. So the above should catch both checked and unchecked exceptions.

    If you can’t still get into the catch block – then the msgProcessor.processMsg() may be swallowing exceptions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was using some code to try to count the number of processors in
We’ve found that the unit tests we’ve written for our C#/C++ code have really
We have recently started using FxCop on our code base and I am in
I have a dev, that will get around our code coverage by writing tests
In our code we have quite a few cases of this pattern: class outerClass
In many places in our code we have collections of objects, from which we
In our code we used to have something like this: *(controller->bigstruct) = ( struct
I have introduced boost to our code base, on my machine I created a
We have this anonymous function in our code, which is part of the jQuery's
I use Codesmith to create our code generation templates and have had success in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.