When adding @EnableAspectJAutoProxy... get error stating that No matching factory method found transactionAdvisor()
Configuration class:
Code:@Configuration @ComponentScan @EnableTransactionManagement @EnableAspectJAutoProxy public class Configure { @Bean(name="transactionManager") public HibernateTransactionManager hinbernateTransactionManager() { .... } @Bean(name="sessionFactory") public SessionFactory sessionFactory() { .... } @Bean public AnnotationSessionFactoryBean sessionFactoryBean() { .... } @Bean public DataSource dataSource() { .... } }
Aspect Class:
Gives me this errorCode:@Aspect @Component public AspectedClass { @Autowired private SessionFactory sessionFactory @Autowired private UtilityClass utils @Around("@target(org.springframework.transaction.annotation.Transactional)") public Object invoke(ProceedingJointPoint pjp) throws Throwable { .... pjp.proceed() .... } }
Code:Caused by:org.springframework.beans.factory.BeanCreationException: Error creating bean name with name 'org.springframework.transaction.config.internalTransactionAdvisor' defined in class path resource [org/springframework/transaction/annotation/ProxyTransactionMamagementConfiguration.class]: No matching factory method found: factory bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration#0'; factory method 'transactionAdvisor()'. Check that a method with the specified name exist and that it is non-static. at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ContrcutionsResolver.java:528)


Reply With Quote