Sunday, November 11, 2012

Spring Framework Pitfalls

UndeclaredThrowableException thrown

This exception may occur when you are manipulating exception and changing it to exception type thrown by your method using AfterThrownAdvice or Around Advice. You can correct it either making your custom exception a Runtime Exception or explicitly mark your method to throw custom exception using "throws" clause.

Inherited Methods are not being adviced

Suppose you are using inheritance and want to advice both inherited methods and new methods in child class and you will be surprised that advice is not working on inherited methods. Yes that's true, it does not work unless you specifically also include parent include to be adviced.

I will keep on updating it with my findings...