Solved

How to ignore exceptions thrown by Advice class

Posted on 2008-09-30
4
942 Views
Last Modified: 2013-11-11
Say I have an AOP advice method that throws an exception.

I have after-throwing interceptors (multiple) in place to log the exception but after that I wish to catch the exception and ignore it, but only if it eminates from the advice code, and not the original proxied class.

Is there a way to do this so that the exception from the aop advice does not interfere with the operation of the main application, or do I need to set up every advice method with an @Around and handle it within there?

Can I set up a pointcut on Advice methods so that I can trap exceptions only if they occur within the advice methods?
0
Comment
Question by:sweetfa2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
Thlware earned 500 total points
ID: 22631123
try{
.....your operations
}catch(AdviceException e){ //do nothing in here }
0
 
LVL 17

Author Comment

by:sweetfa2
ID: 22631707
Thanks, I was looking for a way to do it that is generic without wrapping each of my operations.  I have created a wrapper class at the moment that does all that but it means that I can't use the <aop: options to configure anything as the afterReturning etc methods need to be wrapped with the error handling wrapper.
0
 
LVL 17

Author Closing Comment

by:sweetfa2
ID: 31501823
Wasn't really what I wanted but simplistically is a workable solution, and you did bother to respond, so you get the points.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question