Solved

How to ignore exceptions thrown by Advice class

Posted on 2008-09-30
4
937 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
  • 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
base64 decode encode 12 119
get weblogic logged in user in java 2 57
maven project error 5 48
How to increase Spring boot/Tomcat max file upload size 2 17
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now