This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Advisor Not Being Called

Jun 9th, 2008, 03:09 PM

For someone reason my ThrowsAdvice is not being invoked, even when I deliberately throw an exception to test it. I'm not getting any errors (other than the expected stack trace from the deliberately thrown exception), but the advice isn't executed. Configuration file:

Well your test is pretty useless for testing your advice... Remember that your DAO is adviced NOT your test class, currently you are testing the advice on your testclass.. So if you want to test anything throw the exception INSIDE your DAO.

Comment

Why do you say that only the DAO is advised? The pointcut expression "execution(* *(..))" would cause ALL classes in the app to be advised, wouldn't it? At least, that was our intent? If it doesn't do that, how would write it so it does?