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 8339113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:47:37+00:00 2026-06-09T04:47:37+00:00

I cannot understand why advice @After is applied instead of @AfterThrowing in this situation:

  • 0

I cannot understand why advice @After is applied instead of @AfterThrowing in this situation:

    @Pointcut("execution(* componentB.Bye.run())")
    public void newThread(){
    }

    @After("newThread()")
    public void cokolwiek2(JoinPoint joinPoint){
        report(joinPoint);
    }

    @AfterThrowing(pointcut="newThread()",throwing="e")
public void itsAFoo(JoinPoint joinPoint, RemoteException e) {
        logger.error(joinPoint.getSignature().toLongString() + " exception here!");
}

I am sure that exception is thrown in:

public String greeting(String c) throws RemoteException,
        InterruptedException {
    throw new RemoteException();
    //return "Good morning!";
}

But there is no log with exception here!

  • 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-06-09T04:47:39+00:00Added an answer on June 9, 2026 at 4:47 am

    The pointcut execution(* componentB.Bye.run()) doesn’t cover method public String greeting(String c).

    The difference between @After and @AfterThrowing is that @AfterThrowing is called only when an exception occurred, while @After is called either if an exception was thrown or the method returned successfully. So if there is an exception and you have both advises, both of them will be executed.

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

Sidebar

Related Questions

I cannot understand why a call to read after an lseek returns 0 number
I cannot understand why the code below is giving me this error in firebug
I cannot understand why this throws undefined reference to `floor' : double curr_time =
I cannot understand why I am getting deadlock in this simple sample.What is wrong
I cannot understand this query? select @:vfOutBalance+@:vfHSSubTotal+@3+orpartpayment,@:vfOutBalance+@:vfHSSubTotal from or_equip_upgrd_id what does @3 mean?
I have a problem with CSS and HTML I cannot understand why this is
I cannot understand why this simple query is not created. I call this method
I cannot understand why this piece of code does not compile: namespace A {
Folks, This seems like a basic program and I cannot understand what is going
This has always baffled me, I understand the concept of pretty URLs yet cannot

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.