Solved

How to ignore exceptions thrown by Advice class

Posted on 2008-09-30
4
935 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
Comment Utility
try{
.....your operations
}catch(AdviceException e){ //do nothing in here }
0
 
LVL 17

Author Comment

by:sweetfa2
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This video teaches viewers about errors in exception handling.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

763 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

10 Experts available now in Live!

Get 1:1 Help Now