Hi,
I'm trying to setup a spring managed @AspectJ style aspect. Just to be clear I'm using AspectJ, not SpringAOP, with the Tomcat LTW.
Upon application statup I get the following error, when Spring tres to initialize my aspect.
This would imply that the aspectOf method needs to be implement on my aspect. Yet, I haven't seen any mention of this requirment in the docs. If I were using CTW the compile time weaver would have added this method for me. Does the LTW not provide this method?Code:No matching factory method found: factory method 'aspectOf'
I've included my Aspect, aop.xml, and portions of my application context.xml below. Anythoughts would be helpful
My Aspect:
My Aop.xmlCode:@Aspect public class SetUserCredentialsAspect extends JdbcDaoSupport{ @Pointcut("initialization(webservices.service.admin.*.new(..))") private void adminServices(){} //@Pointcut("") //private void userValidatorInterceptor(){} @Before("adminServices") private void setAdminServices() { logger.warn("^^^^^^^^^^^^^^^^^^^HERE^^^^^^^^^^^^^^^^^^^^^"); } public static SetUserCredentialsAspect aspectOf(){ return Aspects.aspectOf(SetUserCredentialsAspect.class); } }
ApplicationContext.xmlCode:<aspectj> <weaver options="-showWeaveInfo -verbose"> <include within="webservices"/> </weaver> <aspects> <aspect name="org.springframework.transaction.aspectj.AnnotationTransactionAspect" /> <aspect name="gov.gov.ic.dia.wiseism.webservices.aspects.SetUserCredentialsAspect" /> </aspects> </aspectj
Code:<!-- Turn on the LTW --> <context:load-time-weaver aspectj-weaving="on" /> <tx:annotation-driven transaction-manager="transactionManager" order="1000" mode="aspectj" /> <!-- Turn on Aspect J --> <!--<aop:aspectj-autoproxy/>--> <bean class="org.springframework.transaction.aspectj.AnnotationTransactionAspect" factory-method="aspectOf" dependency-check="none"> <property name="transactionManager" ref="transactionManager"/> </bean> <bean id="setUserCredentialsAspect" class="webservices.aspects.SetUserCredentialsAspect" factory-method="aspectOf" dependency-check="none"> <property name="jdbcTemplate" ref="jdbcTemplate"/> </bean>


Reply With Quote