I am just starting with spring aop so please bear with me.
And i cant really figure out whats going on
This is what I have -
And i can see inside the debug logs --Code:public class BatchingAspect implements ThrowsAdvice{ private transient Log log = LogFactory.getLog(BatchingAspect.class){ public void afterThrowing(Exception ex) { log.error("i am inside afterThrowing of BatchingAspect"); System.out.println("i am inside afterThrowing of BatchingAspect"); } } public class AtomAnteDaoHibernate extends HibernateBaseDao<AtomAnte> implements AtomAnteDao { private transient Log log = LogFactory.getLog(AtomAnteDaoHibernate.class); public List<AtomAnte> loadAntes(List<Long> atoms) throws ObjectNotFoundException { if(true) { log.debug("throwing UncategorizedSQLException"); throw new UncategorizedSQLException("myTask","select * from t", new SQLException("Too many ANDs or ORs in expression (limit 1024 per expression level). Try splitting query or limiting ANDs and ORs.","ZZZZZ",404)); } } } and my spring config - <bean id="batchingAspect" class="BatchingAspect" /> <aop:config> <aop:pointcut id="getListMethod" expression="execution(* AtomAnteDaoHibernate.loadAntes(..))"/> <aop:advisor advice-ref="batchingAspect" pointcut-ref="getListMethod" /> </aop:config>
19:41:16,589 DEBUG [org.springframework.aop.framework.adapter.ThrowsAd viceInterceptor] Found exception handler method: public void BatchingAspect.afterThrowing(java.lang.Exception)
19:41:16,591 DEBUG [AtomAnteDaoHibernate] throwing UncategorizedSQLException
I dont know what i am doing wrong, my aspect is not called.
the same thing works outside of jboss(or atleast simliar configuration).


Reply With Quote