Hi all, I have a Spring + JPA setup that works fine. The transactional services use annotation metadata as following:
and the applicationContext.xml contains the <tx:annotation-driven /> namespace tag.Code:@Service public class MyServiceImpl implements MyService { @Override @Transactional public void myMethod() { // Implementation here } }
Instead of the standard setup provided by <tx:annotation-driven />, I would like to customize the parser that reads the transactional metadata (I want to add extra transactional metadata to the methods to be used in my dialect).
Therefore I removed the <tx:annotation-driven /> tag from the applicationContext.xml and I re-defined the beans that are usually added by <tx:annotation-driven /> as following:
Everytime I start the server Spring complains about missing AspectJ... How could I reproduce the behavior of <tx:annotation-driven /> defining explicitly all the needed beans?Code:<aop:config /> <bean name="txInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor"> <property name="transactionManagerBeanName" value="transactionManager" /> <property name="transactionAttributeSource"> <bean class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"> <constructor-arg index="0"> <bean class="com.example.MyAnnotationParser" /> </constructor-arg> </bean> </property> </bean> <bean id="org.springframework.transaction.config.internalTransactionAdvisor" class="org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor"> <property name="transactionAttributeSource"> <bean class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"> <constructor-arg index="0"> <bean class="com.example.MyAnnotationParser" /> </constructor-arg> </bean> </property> <property name="adviceBeanName" value="txInterceptor"/> </bean>
With <tx:annotation-driven /> everything works fine without AspectJ, I would like to have the same, but defined in my applicationContext.xml rather than using <tx:annotation-driven />.
Does anybody have a clue?


Reply With Quote
