File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes How to catch the exeception throwed from an advice Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Spring
Reply Bookmark "How to catch the exeception throwed from an advice" Watch "How to catch the exeception throwed from an advice" New topic
Author

How to catch the exeception throwed from an advice

sanjey asok
Ranch Hand

Joined: Jul 11, 2009
Posts: 35
I have my own exeception "MyOwnExeception" and throw this exeception from my service class



Now I want to catch MyOwnExeception in an advice and rethrow a brand-new Execepton



Now,I want to catch the re-thrown "Exception" from the above Advice "SimpleThrowsAdvice ",

How I can catch exeception "Exeception"?.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 23635

Sanjey,
Are you saying you want the Aspect to convert the exception from one to another? If so, you need to use an around advice. This lets you add a try/catch and rethrow the new exception.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Certs: SCEA Part 1, Part 2 & 3 & Core Spring 3, OCAJP
 
 
subject: How to catch the exeception throwed from an advice
 
Threads others viewed
How to capture the exceptions thrown from third party services in servlet
conevert axis Remote exceptions to my runtime exceptions
Exception
An "exceptional" error
Construtor and Member variables
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture