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

  • SEARCH
  • Home
  • 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 6749555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:42:16+00:00 2026-05-26T12:42:16+00:00

I am invoking a method from within an AOP (Spring) (Around advice). Once the

  • 0

I am invoking a method from within an AOP (Spring) (Around advice).
Once the method returns i do some checking on the object and if i am not happy with the results i throw an exception (my own). However, when the aspect returns, instead of my exception i get an “UndeclaredThrowableException”
Any idea how to handle this?

  • 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-26T12:42:17+00:00Added an answer on May 26, 2026 at 12:42 pm

    If you look at the documentation for UndeclaredThrowableException it mentions that this occurs due to the the fact that a checked exception is being thrown that is not expected by the method signature that you are using as a joinpoint.

    The way it appears you should deal with this situation is to make the exception that you are throwing a Runtime exception (extends Runtime Exception).

    Its worth noting you seem to be able to access the original exception like so:

    try {
        ...
    }
    catch(UndeclaredThrowableException e) {
        e.getUndeclaredThrowable();
    }
    

    However I reckon that is the wrong way to go about solving the problem you are having.

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

Sidebar

Related Questions

I have a method invoking bean which calls a method to perform some sort
I ran into a situation today where Java was not invoking the method I
I have a 'generic' boiler plate static method for checking for InvokeRequired and invoking
When invoking the method push_back from std::vector , its size is incremented by one,
i have thread (working great ) that invoking method in singletone object like this:
guys,i am confused by invoking the following method: Calendar.getInstance().get(Calendar.WEEK_OF_YEAR) ,the result got from that
My question is based around invoking a server method by using the command pattern.
Suppose I want to throw a new exception when invoking a generic method with
I'm invoking one of SharePoint's web service APIs that returns a CAML fragment. I've
I am invoking camera from my application. i want to remove few menu items

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.