I am trying to create a pointcut expression to select the methods of all beans annotated with @Repository. Here is one of the beans I am trying to capture:
The Spring config for the aspect is:Code:@Repository public class ListDAOImpl extends HibernateDaoSupport implements ListDAO { @SuppressWarnings("unchecked") public List<Decision> listLiteDecisions() { return (List<Decision>) getHibernateTemplate().findByNamedQuery("Decision.listLiteDecisions"); } }
For some reason, it is trying to proxy a bean that does not have this annotation on it, and its barfing because it does not have a no-args constructor:Code:<aop:aspect id="profileAspect" ref="daoProfiler"> <aop:pointcut id="debug" expression="@target(org.springframework.stereotype.Repository) and execution(* com.db.fir..*.*(..))"/> <aop:around pointcut-ref="debug" method="profile"/> </aop:aspect>
When I remove the aspect config, the app deploys and runs correctly (ie, the offending bean is fine on its own). Is there something wrong with my pointcut expression? I don't believe it should be trying to proxy this other bean.Code:Caused by: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.db.fir.bloomberg.Bloomberg]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given


Reply With Quote